1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
JUCE/modules/juce_graphics
reuk 3768349a05
Font: Make Font and TypefaceCache threadsafe
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 */ });
2021-09-23 10:28:47 +01:00
..
colour Colour: Remove restrictions on argument to brighter() and darker() 2021-06-30 17:03:38 +01:00
contexts Font: Make Font and TypefaceCache threadsafe 2021-09-23 10:28:47 +01:00
effects Clang: Fix warnings when building with clang 10 2020-07-01 10:00:43 +01:00
fonts Font: Make Font and TypefaceCache threadsafe 2021-09-23 10:28:47 +01:00
geometry PathFlatteningIterator: Ensure iterator terminates when flattening paths with very large coordinate values 2021-06-04 13:04:24 +01:00
image_formats Fixed some warnings flagged by Clang's static analyzer 2021-07-19 15:48:31 +01:00
images Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
native Font: Make Font and TypefaceCache threadsafe 2021-09-23 10:28:47 +01:00
placement Updated all license headers 2020-06-29 08:30:22 +01:00
juce_graphics.cpp AudioProcessorGraph: Improve performance when building large graphs 2021-07-08 10:47:36 +01:00
juce_graphics.h Bump version number to 6.1.2 2021-09-20 12:15:47 +01:00
juce_graphics.mm Updated all license headers 2020-06-29 08:30:22 +01:00