summaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/GLContextImpl.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-02-23 08:02:08 +0000
committerKenneth Russel <[email protected]>2006-02-23 08:02:08 +0000
commit5fbc462246a5d40833697902e84f2b2076e735a2 (patch)
treee9072221589216aabd499316efdf6e7296f9dd91 /src/classes/com/sun/opengl/impl/GLContextImpl.java
parent76e7d4bd24490eb73914fa7461baf86da17f584d (diff)
Added mechanism for kicking the current context off the
GLWorkerThread. Tested with modified version of demos.texture.TestTexture doing the loading in another thread with manual makeCurrent()/release() calls (not recommended style). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@634 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/GLContextImpl.java')
-rw-r--r--src/classes/com/sun/opengl/impl/GLContextImpl.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java
index a4eee6652..4a6885f45 100644
--- a/src/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -96,6 +96,12 @@ public abstract class GLContextImpl extends GLContext {
}
}
+ if (GLWorkerThread.isStarted() &&
+ !GLWorkerThread.isWorkerThread()) {
+ // Kick the GLWorkerThread off its current context
+ GLWorkerThread.invokeLater(new Runnable() { public void run() {} });
+ }
+
lock.lock();
int res = 0;
try {
@@ -345,4 +351,8 @@ public abstract class GLContextImpl extends GLContext {
public GLObjectTracker getObjectTracker() {
return tracker;
}
+
+ public boolean hasWaiters() {
+ return lock.hasWaiters();
+ }
}