From df85f0dfafc09e147f9d422adf5ee8eabf67977b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 27 Sep 2011 11:59:06 +0200 Subject: Adapt to GlueGen's Lock ChangeSet: e4baba27507ce78e64a150ec6f69fb96f5721a34 ; Use generics --- .../classes/javax/media/nativewindow/ProxySurface.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/nativewindow/classes/javax/media') diff --git a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java index 038580ce0..e34476228 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java +++ b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java @@ -28,10 +28,11 @@ package javax.media.nativewindow; +import com.jogamp.common.util.locks.LockFactory; import com.jogamp.common.util.locks.RecursiveLock; public abstract class ProxySurface implements NativeSurface { - protected RecursiveLock surfaceLock = new RecursiveLock(); + protected RecursiveLock surfaceLock = LockFactory.createRecursiveLock(); protected AbstractGraphicsConfiguration config; protected long displayHandle; protected int height; @@ -86,7 +87,7 @@ public abstract class ProxySurface implements NativeSurface { public int lockSurface() throws NativeWindowException { surfaceLock.lock(); - int res = surfaceLock.getRecursionCount() == 0 ? LOCK_SURFACE_NOT_READY : LOCK_SUCCESS; + int res = surfaceLock.getHoldCount() == 1 ? LOCK_SURFACE_NOT_READY : LOCK_SUCCESS; // new lock ? if ( LOCK_SURFACE_NOT_READY == res ) { try { @@ -111,7 +112,7 @@ public abstract class ProxySurface implements NativeSurface { public final void unlockSurface() { surfaceLock.validateLocked(); - if (surfaceLock.getRecursionCount() == 0) { + if (surfaceLock.getHoldCount() == 1) { final AbstractGraphicsDevice adevice = config.getScreen().getDevice(); try { unlockSurfaceImpl(); @@ -142,9 +143,5 @@ public abstract class ProxySurface implements NativeSurface { return surfaceLock.getOwner(); } - public final int getSurfaceRecursionCount() { - return surfaceLock.getRecursionCount(); - } - public abstract String toString(); } -- cgit v1.2.3