The Apple threading documentation [^1] says the following:
> The second argument to pthread_setschedparam is the desired policy,
which can currently be one of SCHED_FIFO (first in, first out),
SCHED_RR (round-robin), or SCHED_OTHER. The SCHED_OTHER policy is
generally used for extra policies that are specific to a given
operating system, and should thus be avoided when writing portable
code.
This appears to differ from the policy semantics on Linux and BSD, where
FIFO and RR are both explicitly real-time policies.
Therefore, on Linux/BSD we only enable the RR policy if the requested
priority is 8 or higher. Meanwhile, on macOS, we map all thread
priorities (0 - 10) onto the RR policy with an appropriate priority.
[^1]: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html
The Apple threading documentation [^1] says the following:
> The second argument to pthread_setschedparam is the desired policy,
which can currently be one of SCHED_FIFO (first in, first out),
SCHED_RR (round-robin), or SCHED_OTHER. The SCHED_OTHER policy is
generally used for extra policies that are specific to a given
operating system, and should thus be avoided when writing portable
code.
This appears to differ from the policy semantics on Linux and BSD, where
FIFO and RR are both explicitly real-time policies.
Therefore, on Linux/BSD we only enable the RR policy if the requested
priority is 8 or higher. Meanwhile, on macOS, we map all thread
priorities (0 - 10) onto the RR policy with an appropriate priority.
[^1]: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html
Previously, we were using the window's top-left position to determine
the scale to use for the OpenGLContext. However, on macOS the
backingScaleFactor of the window is not strictly related to the top-left
corner of the window, so the OpenGL view's scale could end up differing
from the backing scale factor when slowly moving a window between
displays with different backing scale factors.
On macOS, we now use the backing scale factor of the window's screen (as
maintained by AppKit), rather than trying to work out the correct
display and scale ourselves.
This fixes an issue on iOS platforms where the version number string is
prefixed with "OpenGL ES " despite the Khronos docs for OpenGL ES
specifying that "The GL_VERSION and GL_SHADING_LANGUAGE_VERSION strings
begin with a version number".
This commit removes the various compiler-specific JUCE_DEPRECATED macros and replaces them with C++14's deprecated attribute. It also removes the JUCE_CATCH_DEPRECATED_CODE_MISUSE flag as we can rely on the override specifier catching usage of these old virtual methods, and tidies up the DOXYGEN preprocessor checks as they were inconsistent across the codebase.
Previously, it wasn't safe to access Font instances from multiple
threads because there was a chance that they might reference the same
shared internal state. In this case, calling getTypeface() or getAscent from
two threads simultaneously would cause a race on the typeface and ascent
data members, even though the Font instances appeared to be disjoint.
With this change in place, it is now safe to use Font instances from
multiple threads simultaneously.
It is still an error to modify the same Font instance from multiple
threads without synchronization!
// Fine:
Font a;
Font b = a;
auto futureA = std::async (std::launch::async, [&a] { /* do something with a */ });
auto futureB = std::async (std::launch::async, [&b] { /* do something with b */ });
// Bad idea:
Font f;
auto futureA = std::async (std::launch::async, [&f] { /* do something with f */ });
auto futureB = std::async (std::launch::async, [&f] { /* do something with f */ });
Previously, we were always adding a #version 150 directive to shaders
when the GLSL version was higher than 1.2, which could cause compilation
to fail on platforms with GLSL versions between 1.2 and 1.5.
On Linux, repaints are only issued if the number of received SHM
completion events matches the number of events initiated with
`xShmPutImage`.
Previously, destroying a GL context was calling `XSync (display, True)`
which cleared the event queue. Sometimes, this would cause an 'SHM
Completion Event' to be removed from the queue. This meant that the
number of received events would never match the number of initiated
events, and repainting would stop indefinitely.
By calling `XSync (display, False)` instead, we ensure that pending
events are kept in the queue, so any pending SHM completion event will
be found as usual during the next repaint timer callback.