diff options
Diffstat (limited to 'src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java')
-rw-r--r-- | src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java b/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java index b4e6ce0..7c88400 100644 --- a/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java +++ b/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java @@ -34,11 +34,18 @@ public class RecursiveLockImplJava5 implements RecursiveLock { } public void unlock() throws RuntimeException { + unlock(null); + } + + public void unlock(Runnable taskAfterUnlockBeforeNotify) { validateLocked(); owner = null; + if(null!=taskAfterUnlockBeforeNotify) { + taskAfterUnlockBeforeNotify.run(); + } lock.unlock(); } - + public boolean isLocked() { return lock.isLocked(); } @@ -59,7 +66,7 @@ public class RecursiveLockImplJava5 implements RecursiveLock { return lock.isLocked() && owner == thread; } - public void validateLocked() { + public void validateLocked() throws RuntimeException { if ( !lock.isHeldByCurrentThread() ) { if ( !lock.isLocked() ) { throw new RuntimeException(Thread.currentThread()+": Not locked"); |