| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | addOwner(final Thread
the thread to be added to the list of additional owning threads t)Implements com. |
| public final boolean | isOriginalOwner()
Implements com. |
| public final boolean | isOriginalOwner(final Thread thread)
Implements com. |
| public final void | removeOwner(final Thread
the thread to be removed from the list of additional owning threads t)Implements com. |
| public String | toString()
Overrides jogamp. |
| public final void | unlock(final Runnable taskAfterUnlockBeforeNotify)
Overrides jogamp. Implements com. Wait's until all additional owners released this lock before releasing it. |
| RecursiveThreadGroupLockImpl01Unfairish | back to summary |
|---|---|
| public RecursiveThreadGroupLockImpl01Unfairish() | |
| addOwner | back to summary |
|---|---|
| public final void addOwner(final Thread t) throws RuntimeException, IllegalArgumentException Implements com. Doc from com. Add a thread to the list of additional lock owners, which enables them to recursively claim this lock.
The caller must hold this lock and be the original lock owner, see
If the original owner releases this lock via
Thread2 thread2 = new Thread2();
Thread1 {
// Claim this lock and become the original lock owner.
lock.lock();
try {
// Allow Thread2 to claim the lock, ie. make thread2 an additional lock owner
addOwner(thread2);
// Start thread2
thread2.start();
// Wait until thread2 has finished requiring this lock, but keep thread2 running
while(!thread2.waitForResult()) sleep();
// Optional: Only if sure that this thread doesn't hold the lock anymore,
// otherwise just release the lock via unlock().
removeOwner(thread2);
} finally {
// Release this lock and remove all additional lock owners.
// Implicit wait until thread2 gets off the lock.
lock.unlock();
}
}.start();
| |
| isOriginalOwner | back to summary |
|---|---|
| public final boolean isOriginalOwner() Implements com. Doc from com. Returns true if the current thread is the original lock owner, ie.
successfully claimed this lock the first time, ie.
| |
| isOriginalOwner | back to summary |
|---|---|
| public final boolean isOriginalOwner(final Thread thread) Implements com. Doc from com. Returns true if the passed thread is the original lock owner, ie.
successfully claimed this lock the first time, ie.
| |
| removeOwner | back to summary |
|---|---|
| public final void removeOwner(final Thread t) throws RuntimeException, IllegalArgumentException Implements com. Doc from com. Remove a thread from the list of additional lock owner threads.
The caller must hold this lock and be the original lock owner, see Only use this method if sure that the thread doesn't hold the lock anymore.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides jogamp. Doc from java. Returns a string representation of the object. | |
| unlock | back to summary |
|---|---|
| public final void unlock(final Runnable taskAfterUnlockBeforeNotify) Overrides jogamp. Implements com. Doc from com. Wait's until all additional owners released this lock before releasing it. Execute theRunnable taskAfterUnlockBeforeNotify while holding the exclusive lock.
Then release the lock.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private Thread[] | |
| private Thread |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| pack-priv String | |
| public final void | |
| public final int | |
| public final int | |
| public final Thread | |
| public final void | |
| public final boolean | |
| public final boolean | |
| public final void | |
| public final void | |
| public final void |
| holdCountAdditionOwner | back to summary |
|---|---|
| private int holdCountAdditionOwner | |
| threadNum | back to summary |
|---|---|
| private int threadNum | |
| threads | back to summary |
|---|---|
| private Thread[] threads | |
| waitingOrigOwner | back to summary |
|---|---|
| private Thread waitingOrigOwner | |
| ThreadGroupSync | back to summary |
|---|---|
| pack-priv ThreadGroupSync() | |
| addOwner | back to summary |
|---|---|
| public final void addOwner(final Thread t) throws IllegalArgumentException | |
| addOwnerToString | back to summary |
|---|---|
| pack-priv String addOwnerToString() | |
| decrHoldCount | back to summary |
|---|---|
| public final void decrHoldCount(final Thread t) Overrides jogamp. Implements jogamp.
| |
| getAdditionalOwnerHoldCount | back to summary |
|---|---|
| public final int getAdditionalOwnerHoldCount() | |
| getAddOwnerCount | back to summary |
|---|---|
| public final int getAddOwnerCount() | |
| getWaitingOrigOwner | back to summary |
|---|---|
| public final Thread getWaitingOrigOwner() | |
| incrHoldCount | back to summary |
|---|---|
| public final void incrHoldCount(final Thread t) Overrides jogamp. Implements jogamp.
| |
| isOriginalOwner | back to summary |
|---|---|
| public final boolean isOriginalOwner(final Thread t) | |
| isOwner | back to summary |
|---|---|
| public final boolean isOwner(final Thread t) Overrides jogamp. Implements jogamp.
| |
| removeAllOwners | back to summary |
|---|---|
| public final void removeAllOwners() | |
| removeOwner | back to summary |
|---|---|
| public final void removeOwner(final Thread t) throws IllegalArgumentException | |
| setWaitingOrigOwner | back to summary |
|---|---|
| public final void setWaitingOrigOwner(final Thread origOwner) | |