From 3ed491213f8f7f05d7b9866b50d764370d8ff5f6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 25 Mar 2012 03:29:53 +0200 Subject: Enhance and generalize AWT Threading* implementation; Minor changes .. Threading*: - add invoke(..) generalizing the Therading decision GLCanvas: - remove 'manual' Threading decision, simply call Threading.invoke(..) - use anonymous Runnable instances - remove drawable lock, drawable is volatile instead GLJPanel: - remove 'manual' Threading decision, simply call Threading.invoke(..) - use anonymous Runnable instances - DEBUG: Use getThreadName() prefix GLContextImpl: - Remove GLWorkerThread idle command on makeCurrent(), no holding of context in worker thread while idle. - DEBUG: Use getThreadName() prefix X11GLXContext: - DEBUG: Use getThreadName() prefix TODO: Validate whether it's OK for GLCanvas and GLJPanel to set Threading.Mode.MT as the default mode! --- .../test/junit/jogl/demos/gl2/awt/TestGearsAWT.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/test/com') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java index 08c073c13..ff24979eb 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java @@ -41,6 +41,9 @@ import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.util.QuitAdapter; import java.awt.Frame; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import org.junit.Assert; @@ -51,7 +54,7 @@ import org.junit.Test; public class TestGearsAWT extends UITestCase { static GLProfile glp; static int width, height; - static boolean firstUIActionOnProcess = false; + static boolean waitForKey = false; @BeforeClass public static void initClass() { @@ -63,6 +66,8 @@ public class TestGearsAWT extends UITestCase { } else { setTestSupported(false); } + // Runtime.getRuntime().traceInstructions(true); + // Runtime.getRuntime().traceMethodCalls(true); } @AfterClass @@ -127,10 +132,17 @@ public class TestGearsAWT extends UITestCase { try { duration = Integer.parseInt(args[i]); } catch (Exception ex) { ex.printStackTrace(); } - } else if(args[i].equals("-firstUIAction")) { - firstUIActionOnProcess = true; + } else if(args[i].equals("-wait")) { + waitForKey = true; } } + if(waitForKey) { + BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); + System.err.println("Press enter to continue"); + try { + System.err.println(stdin.readLine()); + } catch (IOException e) { } + } org.junit.runner.JUnitCore.main(TestGearsAWT.class.getName()); } } -- cgit v1.2.3