diff options
author | Sven Gothel <[email protected]> | 2011-02-22 14:21:29 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-02-22 14:21:29 +0100 |
commit | e587f2a724c79d50118f717cc29fba78cad0feeb (patch) | |
tree | 06e2a661139f477a387c4d2835d9359fa7f0399f /src/nativewindow/classes/jogamp | |
parent | 1411387d54bc5d946bd3528f97c9a2a15dd2f9de (diff) |
NativeWindow NativeSurface lock/unlock Surface cleanup ; NEWT WindowImpl lock/unlock Surface fix
- Rename lock to surfaceLock to determine it's use
- NEWT's WindowImpl windowLock usage is not sufficient for lock/unlock surface.
Using distinguished surfaceLock for proper recursion count on lock/unlock surface.
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java index 0f7f1ee62..781882f08 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java @@ -107,13 +107,13 @@ public abstract class JAWTWindow implements NativeWindow { // NativeSurface // - private RecursiveLock recurLock = new RecursiveLock(); + private RecursiveLock surfaceLock = new RecursiveLock(); protected abstract int lockSurfaceImpl() throws NativeWindowException; public final int lockSurface() throws NativeWindowException { - recurLock.lock(); - int res = recurLock.getRecursionCount() == 0 ? LOCK_SURFACE_NOT_READY : LOCK_SUCCESS; + surfaceLock.lock(); + int res = surfaceLock.getRecursionCount() == 0 ? LOCK_SURFACE_NOT_READY : LOCK_SUCCESS; if ( LOCK_SURFACE_NOT_READY == res ) { try { @@ -128,7 +128,7 @@ public abstract class JAWTWindow implements NativeWindow { } } finally { if (LOCK_SURFACE_NOT_READY >= res) { - recurLock.unlock(); + surfaceLock.unlock(); } } } @@ -138,9 +138,9 @@ public abstract class JAWTWindow implements NativeWindow { protected abstract void unlockSurfaceImpl() throws NativeWindowException; public final void unlockSurface() { - recurLock.validateLocked(); + surfaceLock.validateLocked(); - if (recurLock.getRecursionCount() == 0) { + if (surfaceLock.getRecursionCount() == 0) { final AbstractGraphicsDevice adevice = config.getScreen().getDevice(); try { unlockSurfaceImpl(); @@ -148,19 +148,19 @@ public abstract class JAWTWindow implements NativeWindow { adevice.unlock(); } } - recurLock.unlock(); + surfaceLock.unlock(); } public final boolean isSurfaceLockedByOtherThread() { - return recurLock.isLockedByOtherThread(); + return surfaceLock.isLockedByOtherThread(); } public final boolean isSurfaceLocked() { - return recurLock.isLocked(); + return surfaceLock.isLocked(); } public final Thread getSurfaceLockOwner() { - return recurLock.getOwner(); + return surfaceLock.getOwner(); } public final boolean surfaceSwap() { |