1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-05 03:50:07 +00:00
JUCE/modules/juce_opengl/opengl
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
..
juce_gl.cpp OpenGL: Only load the core API by default 2021-08-11 14:31:48 +01:00
juce_gl.h OpenGL: Only load the core API by default 2021-08-11 14:31:48 +01:00
juce_gles2.cpp OpenGL: Only load the core API by default 2021-08-11 14:31:48 +01:00
juce_gles2.h OpenGL: Only load the core API by default 2021-08-11 14:31:48 +01:00
juce_khrplatform.h OpenGL: Add GLEW-inspired dynamic function loading 2021-05-26 11:23:49 +01:00
juce_OpenGLContext.cpp OpenGLContext: Avoid reading from component on background thread 2021-09-22 10:23:05 +01:00
juce_OpenGLContext.h OpenGL: Check at runtime whether non-power-of-two textures are supported 2021-07-05 12:21:36 +01:00
juce_OpenGLFrameBuffer.cpp Windows: Fix and suppress some analysis warnings 2021-05-26 15:34:26 +01:00
juce_OpenGLFrameBuffer.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_OpenGLGraphicsContext.cpp Font: Make Font and TypefaceCache threadsafe 2021-09-23 10:28:47 +01:00
juce_OpenGLGraphicsContext.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_OpenGLHelpers.cpp OpenGL: Fix shader compilation on Ubuntu 18.04 2021-07-05 12:21:36 +01:00
juce_OpenGLHelpers.h OpenGL: Fix shader compilation on Ubuntu 18.04 2021-07-05 12:21:36 +01:00
juce_OpenGLImage.cpp Updated all license headers 2020-06-29 08:30:22 +01:00
juce_OpenGLImage.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_OpenGLPixelFormat.cpp OpenGLPixelFormat: Tidy up equality function 2021-09-22 11:04:47 +01:00
juce_OpenGLPixelFormat.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_OpenGLRenderer.h Font: Make Font and TypefaceCache threadsafe 2021-09-23 10:28:47 +01:00
juce_OpenGLShaderProgram.cpp Windows: Fix and suppress some analysis warnings 2021-05-26 15:34:26 +01:00
juce_OpenGLShaderProgram.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_OpenGLTexture.cpp OpenGL: Check at runtime whether non-power-of-two textures are supported 2021-07-05 12:21:36 +01:00
juce_OpenGLTexture.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_wgl.h Windows: Fix clang/gnu compiler warnings 2021-06-03 17:30:44 +01:00