diff options
author | Kenneth Russel <[email protected]> | 2006-03-22 22:18:21 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-03-22 22:18:21 +0000 |
commit | c75dcfed13f2ca830284cff4bc99f3e921a873fa (patch) | |
tree | 4cb2efb1237cfd3aee46530c59e2950caf7b4829 /src/classes/javax/media/opengl/Threading.java | |
parent | 4a66c6edf9f25503a5a62383d9546ee4fddc1175 (diff) |
Fixed Issue 210: Crashes on Mac OS X related to GLWorkerThread
Worked around crashes related to introduction of GLWorkerThread by
switching back to using the AWT event dispatch thread to perform all
OpenGL work on Mac OS X. It is possible that there are deeper
underlying bugs in the new locking protocol for on-screen GLContext
implementations and that a more correct fix can be found in the future.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@675 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media/opengl/Threading.java')
-rwxr-xr-x | src/classes/javax/media/opengl/Threading.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/classes/javax/media/opengl/Threading.java b/src/classes/javax/media/opengl/Threading.java index 94de9e7d9..6c6d69919 100755 --- a/src/classes/javax/media/opengl/Threading.java +++ b/src/classes/javax/media/opengl/Threading.java @@ -122,18 +122,25 @@ public class Threading { private static boolean singleThreaded = true; private static final int AWT = 1; private static final int WORKER = 2; - private static int mode = WORKER; + private static int mode; static { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { String workaround = System.getProperty("opengl.1thread"); + // Default to using the AWT thread on OS X due to apparent + // instability with using JAWT on non-AWT threads + boolean isOSX = System.getProperty("os.name").equals("Mac OS X"); + int defaultMode = (isOSX ? AWT : WORKER); + mode = defaultMode; if (workaround != null) { workaround = workaround.toLowerCase(); if (workaround.equals("true") || - workaround.equals("auto") || - workaround.equals("worker")) { - // Nothing to do; default = singleThreaded, mode = WORKER + workaround.equals("auto")) { + // Nothing to do; singleThreaded and mode already set up + } else if (workaround.equals("worker")) { + singleThreaded = true; + mode = WORKER; } else if (workaround.equals("awt")) { singleThreaded = true; mode = AWT; |