From 9291731fec7103301ba36511ceb4375f63170e5c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 11 Dec 2011 04:47:27 +0100 Subject: Fix concurrency bug of GLProfile initialization ; Fix SharedResourceRunner 'dead' thread (Applets) GLDrawableFactory: - clarify: public getWasSharedContextCreated(..) -> protected createSharedResource(..) - add: getSharesResourceThread() GLProfile: - proper locking of initSingletion(..) path: - Use RecursiveThreadGroupLock and add/remove GLDrawableFactory's sharesResourceThread while creating it's the sharedResource. This simplifies and fixes GLProfile's locking code. - Fix and simplify initSingleton(boolean) API doc - mark it deprecated. - Add initSingleton() for controlled initialization only, pairing w/ shutdown(..) Remove initSingleton(boolean) calls in code and test! +++ Fix SharedResourceRunner 'dead' thread (Applets) In Applets, stopping an Applet makes the browser Java plugin interrupting and killing all related threads, including our SharedResourceRunner thread. - Validate whether the shared resource thread is alive - Catch interruption in shared resource thread and assume it's a kill signal - releaseSharedResource: clear devicesTried set --- src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java | 2 -- src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java | 2 ++ src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/newt') diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java index ebcc0dd27..105f8369a 100755 --- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java +++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java @@ -170,7 +170,6 @@ public class JOGLNewtApplet1Run extends Applet { glTrace); try { - GLProfile.initSingleton(false); GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName)); caps.setAlphaBits(glAlphaBits); if(0