aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-01-18 04:35:01 +0100
committerSven Gothel <[email protected]>2023-01-18 04:35:01 +0100
commit86460616271743970d1ffb2f64ee671e3deeb4cc (patch)
tree55e79fcca15a6e037a704806038784675203789d /src/jogl/classes
parentd55cc1f40820ae93e8ab0d5930514bc33b3e6a2f (diff)
MacOSXCGLContext: Avoid data race on lastSetNSViewCmd, use local copy like in madeCurrent
Diffstat (limited to 'src/jogl/classes')
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 2c200b664..b577d8639 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -1052,9 +1052,10 @@ public class MacOSXCGLContext extends GLContextImpl
OSXUtil.RunOnMainThread(false /* wait */, false /* kickNSApp */, cmd);
}
final boolean lockCGLContext;
- if( null != lastSetNSViewCmd ) {
- synchronized( lastSetNSViewCmd ) {
- lockCGLContext = lastSetNSViewCmd.done;
+ final SetNSViewCmd _lastSetNSViewCmd = lastSetNSViewCmd;
+ if( null != _lastSetNSViewCmd ) {
+ synchronized( _lastSetNSViewCmd ) {
+ lockCGLContext = _lastSetNSViewCmd.done;
if( lockCGLContext ) {
lastSetNSViewCmd = null; // done, no more required
} else if( DEBUG1398 ) {