aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-27 11:59:06 +0200
committerSven Gothel <[email protected]>2011-09-27 11:59:06 +0200
commitdf85f0dfafc09e147f9d422adf5ee8eabf67977b (patch)
tree2cfa489bc37a8195e0742d8ce48d0d7b2ba468fb /src/nativewindow/classes/jogamp
parente5ab975727134d8249277f4df707b2b14a7788f3 (diff)
Adapt to GlueGen's Lock ChangeSet: e4baba27507ce78e64a150ec6f69fb96f5721a34 ; Use generics
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
index 65fb31d72..2c80392ad 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
@@ -37,6 +37,7 @@
package jogamp.nativewindow.jawt;
+import com.jogamp.common.util.locks.LockFactory;
import com.jogamp.common.util.locks.RecursiveLock;
import java.awt.Component;
@@ -112,13 +113,13 @@ public abstract class JAWTWindow implements NativeWindow {
// NativeSurface
//
- private RecursiveLock surfaceLock = new RecursiveLock();
+ private RecursiveLock surfaceLock = LockFactory.createRecursiveLock();
protected abstract int lockSurfaceImpl() throws NativeWindowException;
public final 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 {
@@ -145,7 +146,7 @@ public abstract class JAWTWindow implements NativeWindow {
public final void unlockSurface() {
surfaceLock.validateLocked();
- if (surfaceLock.getRecursionCount() == 0) {
+ if (surfaceLock.getHoldCount() == 1) {
final AbstractGraphicsDevice adevice = config.getScreen().getDevice();
try {
unlockSurfaceImpl();