From 76444dce2b678a7f6769564abac4f8a73f414609 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sat, 26 Feb 2011 21:43:20 +0100
Subject: Clean/Fix: Threading Code

- Remove unsafe double checked locking
- Annotate safe double checked locking (volatile)
- use 'static final' if possible
---
 src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java')

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) {
-- 
cgit v1.2.3