diff options
author | Sven Gothel <[email protected]> | 2011-12-11 04:06:06 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-11 04:06:06 +0100 |
commit | 8dc2ad6a130c75121bc35e393d1cab89217d4d63 (patch) | |
tree | 517166308137b5c0faf73d927f36dbf946c8f774 /src/java/com/jogamp/common/util/locks | |
parent | e5aaa05c071e311f1f0d8298dce268a3b44d32ea (diff) |
Cleanup Lock Package: API doc, complete throws declaration, interface RecursiveLockImpl01Unfairish.Sync
RecursiveLockImpl01Unfairish changes are in preparation of RecursiveGroupThreadLock.
Diffstat (limited to 'src/java/com/jogamp/common/util/locks')
-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. |