summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-02-26 21:43:20 +0100
committerSven Gothel <[email protected]>2011-02-26 21:43:20 +0100
commit76444dce2b678a7f6769564abac4f8a73f414609 (patch)
tree09358c0a48715c69e7e8f511cf3d9be729177509 /src/jogl/classes/jogamp/opengl/GLWorkerThread.java
parent77546f8968779fbdcfe58f89c6924803642889c7 (diff)
Clean/Fix: Threading Code
- Remove unsafe double checked locking - Annotate safe double checked locking (volatile) - use 'static final' if possible
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLWorkerThread.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLWorkerThread.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
index e57cbe0bc..ac9655fbb 100644
--- a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -40,7 +40,6 @@
package jogamp.opengl;
import java.lang.reflect.InvocationTargetException;
-import java.security.*;
import java.util.*;
import javax.media.opengl.*;
@@ -69,9 +68,11 @@ public class GLWorkerThread {
/** Should only be called by Threading class if creation of the
GLWorkerThread was requested via the opengl.1thread system
- property. */
+ property. <br>
+ * Start the GLWorkerThread iff not started yet!
+ */
public static void start() {
- if (!started) {
+ if (!started) { // volatile: ok
synchronized (GLWorkerThread.class) {
if (!started) {
lock = new Object();