diff options
Diffstat (limited to 'src/java/com/jogamp/common/util')
-rw-r--r-- | src/java/com/jogamp/common/util/locks/Lock.java | 2 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/locks/LockExt.java | 13 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/locks/RecursiveLock.java | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/java/com/jogamp/common/util/locks/Lock.java b/src/java/com/jogamp/common/util/locks/Lock.java index 28f9642..15d01ec 100644 --- a/src/java/com/jogamp/common/util/locks/Lock.java +++ b/src/java/com/jogamp/common/util/locks/Lock.java @@ -72,7 +72,7 @@ public interface Lock { boolean tryLock(long timeout) throws InterruptedException; /** - * Unblocking. + * Release the lock. * * @throws RuntimeException in case the lock is not acquired by this thread. */ diff --git a/src/java/com/jogamp/common/util/locks/LockExt.java b/src/java/com/jogamp/common/util/locks/LockExt.java index 860c03a..974c11a 100644 --- a/src/java/com/jogamp/common/util/locks/LockExt.java +++ b/src/java/com/jogamp/common/util/locks/LockExt.java @@ -44,5 +44,16 @@ public interface LockExt extends Lock { boolean isOwner(Thread thread); - void validateLocked(); + /** + * @throws RuntimeException if current thread does not hold the lock + */ + void validateLocked() throws RuntimeException; + + /** + * Execute the {@link Runnable Runnable taskAfterUnlockBeforeNotify} while holding the exclusive lock. + * <p> + * Then release the lock. + * </p> + */ + void unlock(Runnable taskAfterUnlockBeforeNotify); } diff --git a/src/java/com/jogamp/common/util/locks/RecursiveLock.java b/src/java/com/jogamp/common/util/locks/RecursiveLock.java index e3d677a..efa9789 100644 --- a/src/java/com/jogamp/common/util/locks/RecursiveLock.java +++ b/src/java/com/jogamp/common/util/locks/RecursiveLock.java @@ -29,7 +29,7 @@ package com.jogamp.common.util.locks; /** - * Reentrance locking toolkit, impl a complete fair FIFO scheduler + * Reentrance capable locking toolkit. */ public interface RecursiveLock extends LockExt { /** Return the number of locks issued to this lock by the same thread. |