aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java8
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java34
2 files changed, 19 insertions, 23 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index a3adf5090..1832d4e99 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -842,22 +842,22 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
// NativeWindow completion
//
+ @Override
public final int lockSurface() {
return window.lockSurface();
}
+ @Override
public final void unlockSurface() throws NativeWindowException {
window.unlockSurface();
}
+ @Override
public final boolean isSurfaceLockedByOtherThread() {
return window.isSurfaceLockedByOtherThread();
}
- public final boolean isSurfaceLocked() {
- return window.isSurfaceLocked();
- }
-
+ @Override
public final Thread getSurfaceLockOwner() {
return window.getSurfaceLockOwner();
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 73bd9ed1c..baad77ffb 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -562,6 +562,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// NativeSurface
//
+ @Override
public final int lockSurface() {
windowLock.lock();
surfaceLock.lock();
@@ -590,6 +591,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return res;
}
+ @Override
public final void unlockSurface() {
surfaceLock.validateLocked();
windowLock.validateLocked();
@@ -606,30 +608,24 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
windowLock.unlock();
}
- public final boolean isWindowLockedByOtherThread() {
- return windowLock.isLockedByOtherThread();
- }
-
- public final boolean isWindowLocked() {
- return windowLock.isLocked();
- }
-
- public final Thread getWindowLockOwner() {
- return windowLock.getOwner();
- }
-
+ @Override
public final boolean isSurfaceLockedByOtherThread() {
return surfaceLock.isLockedByOtherThread();
}
- public final boolean isSurfaceLocked() {
- return surfaceLock.isLocked();
- }
-
+ @Override
public final Thread getSurfaceLockOwner() {
return surfaceLock.getOwner();
}
+ public final boolean isWindowLockedByOtherThread() {
+ return windowLock.isLockedByOtherThread();
+ }
+
+ public final Thread getWindowLockOwner() {
+ return windowLock.getOwner();
+ }
+
public long getSurfaceHandle() {
return windowHandle; // default: return window handle
}
@@ -1574,7 +1570,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
public void runOnEDTIfAvail(boolean wait, final Runnable task) {
- if(windowLock.isOwner()) {
+ if(windowLock.isOwner(Thread.currentThread())) {
task.run();
} else {
Screen scrn = getScreen();
@@ -1913,7 +1909,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// special repaint treatment
case WindowEvent.EVENT_WINDOW_REPAINT:
// queue repaint event in case window is locked, ie in operation
- if( isWindowLocked() ) {
+ if( null != getWindowLockOwner() ) {
// make sure only one repaint event is queued
if(!repaintQueued) {
repaintQueued=true;
@@ -1932,7 +1928,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// common treatment
case WindowEvent.EVENT_WINDOW_RESIZED:
// queue event in case window is locked, ie in operation
- if( isWindowLocked() ) {
+ if( null != getWindowLockOwner() ) {
final boolean discardTO = QUEUED_EVENT_TO <= System.currentTimeMillis()-e.getWhen();
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.consumeEvent: "+Thread.currentThread().getName()+" - queued "+e+", discard-to "+discardTO);