diff options
author | Sven Gothel <[email protected]> | 2012-06-27 04:18:53 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-06-27 04:18:53 +0200 |
commit | 834b9e530e652b7ff7c5e222720bce3ad2b11c5f (patch) | |
tree | bac459da1a84abec07f70f74204a4e1deca1d226 /src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java | |
parent | 9a71703904ebfec343fb2c7266343d37a2e4c3db (diff) |
Lock Cleanup (API Change)
- LockExt -> ThreadLock - clarifying semantics (API Change)
- ThreadLock: Remove isOwner(), use isOwner(Thread.currentThread)
- adding @Override
Diffstat (limited to 'src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java')
-rw-r--r-- | src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java b/src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java index 695c9c3..aac9348 100644 --- a/src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java +++ b/src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java @@ -43,12 +43,14 @@ public class RecursiveThreadGroupLockImpl01Unfairish threads = null; holdCountAdditionOwner = 0; } + @Override public final void incrHoldCount(Thread t) { super.incrHoldCount(t); if(!isOriginalOwner(t)) { holdCountAdditionOwner++; } } + @Override public final void decrHoldCount(Thread t) { super.decrHoldCount(t); if(!isOriginalOwner(t)) { @@ -62,6 +64,7 @@ public class RecursiveThreadGroupLockImpl01Unfairish public final boolean isOriginalOwner(Thread t) { return super.isOwner(t); } + @Override public final boolean isOwner(Thread t) { if(getExclusiveOwnerThread()==t) { return true; @@ -136,16 +139,19 @@ public class RecursiveThreadGroupLockImpl01Unfairish super(new ThreadGroupSync()); } + @Override public final boolean isOriginalOwner() { return isOriginalOwner(Thread.currentThread()); } + @Override public final boolean isOriginalOwner(Thread thread) { synchronized(sync) { return ((ThreadGroupSync)sync).isOriginalOwner(thread) ; } } + @Override public final void addOwner(Thread t) throws RuntimeException, IllegalArgumentException { validateLocked(); final Thread cur = Thread.currentThread(); @@ -159,6 +165,7 @@ public class RecursiveThreadGroupLockImpl01Unfairish tgSync.addOwner(t); } + @Override public final void unlock(Runnable taskAfterUnlockBeforeNotify) { synchronized(sync) { final Thread cur = Thread.currentThread(); @@ -196,11 +203,13 @@ public class RecursiveThreadGroupLockImpl01Unfairish } } + @Override public final void removeOwner(Thread t) throws RuntimeException, IllegalArgumentException { validateLocked(); ((ThreadGroupSync)sync).removeOwner(t); } + @Override public String toString() { final ThreadGroupSync tgSync = (ThreadGroupSync)sync; final int hc = sync.getHoldCount(); |