diff options
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(); |