aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLWorkerThread.java7
-rw-r--r--src/jogl/classes/jogamp/opengl/ThreadingImpl.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java8
3 files changed, 6 insertions, 17 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();
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
index d63699aad..67a950185 100644
--- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -203,13 +203,7 @@ public class ThreadingImpl {
throw new InternalError();
case WORKER:
- if (!GLWorkerThread.isStarted()) {
- synchronized (GLWorkerThread.class) {
- if (!GLWorkerThread.isStarted()) {
- GLWorkerThread.start();
- }
- }
- }
+ GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
try {
GLWorkerThread.invokeAndWait(r);
} catch (InvocationTargetException e) {
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
index a681c5b8f..dd493f5ee 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -103,13 +103,7 @@ public class AWTThreadingPlugin implements ThreadingPlugin {
break;
case ThreadingImpl.WORKER:
- if (!GLWorkerThread.isStarted()) {
- synchronized (GLWorkerThread.class) {
- if (!GLWorkerThread.isStarted()) {
- GLWorkerThread.start();
- }
- }
- }
+ GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
try {
GLWorkerThread.invokeAndWait(r);
} catch (InvocationTargetException e) {