Fair scheduling is not guaranteed due to the usage of Object#notify(),
however new lock-applicants will wait if queue is not empty for lock()
and tryLock(timeout>0).
Sync object extends AbstractOwnableSynchronizer, hence monitoring is possible.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static interface |
| Modifier and Type | Field and Description |
|---|---|
| protected final RecursiveLockImpl01Unfairish. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final int | getHoldCount()
Implements com. |
| public final Throwable | getLockedStack()
Returns the Throwable instance generated when this lock was taken the 1st time
and if |
| public final Thread | |
| public final int | |
| public final boolean | |
| public final boolean | isLockedByOtherThread()
Implements com. |
| public final boolean | isOwner(final Thread thread)
Implements com. |
| public final void | lock()
Implements com. TIMEOUT is reached.
|
| pack-priv final String | |
| pack-priv final String | |
| public String | |
| public final boolean | tryLock(long
Maximum time in ms to wait to acquire the lock. If this value is zero,
the call returns immediately either without being able
to acquire the lock, or with acquiring the lock directly while ignoring any scheduling order. timeout)Implements com. maxwait in ms is reached.
|
| public final void | |
| public void | unlock(final Runnable taskAfterUnlockBeforeNotify)
Implements com. Runnable taskAfterUnlockBeforeNotify while holding the exclusive lock.
|
| public final void |
| sync | back to summary |
|---|---|
| protected final RecursiveLockImpl01Unfairish. | |
| RecursiveLockImpl01Unfairish | back to summary |
|---|---|
| public RecursiveLockImpl01Unfairish(final RecursiveLockImpl01Unfairish. | |
| RecursiveLockImpl01Unfairish | back to summary |
|---|---|
| public RecursiveLockImpl01Unfairish() | |
| getHoldCount | back to summary |
|---|---|
| public final int getHoldCount() Implements com. Doc from com. Return the number of locks issued to this lock by the same thread.
| |
| getLockedStack | back to summary |
|---|---|
| public final Throwable getLockedStack() Returns the Throwable instance generated when this lock was taken the 1st time
and if | |
| getOwner | back to summary |
|---|---|
| public final Thread getOwner() Implements com.
| |
| getQueueLength | back to summary |
|---|---|
| public final int getQueueLength() Implements com.
| |
| isLocked | back to summary |
|---|---|
| public final boolean isLocked() Implements com. Doc from com. Query if locked
| |
| isLockedByOtherThread | back to summary |
|---|---|
| public final boolean isLockedByOtherThread() Implements com. Doc from com. Query whether the lock is hold by the a thread other than the current thread.
| |
| isOwner | back to summary |
|---|---|
| public final boolean isOwner(final Thread thread) Implements com. Doc from com. Query whether the lock is hold by the given thread.
| |
| lock | back to summary |
|---|---|
| public final void lock() Implements com. Doc from com. Blocking until the lock is acquired by this Thread or
| |
| syncName | back to summary |
|---|---|
| pack-priv final String syncName() | |
| threadName | back to summary |
|---|---|
| pack-priv final String threadName(final Thread t) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| tryLock | back to summary |
|---|---|
| public final boolean tryLock(long timeout) throws InterruptedException Implements com. Doc from com. Blocking until the lock is acquired by this Thread or
| |
| unlock | back to summary |
|---|---|
| public final void unlock() Implements com. Doc from com. Release the lock.
| |
| unlock | back to summary |
|---|---|
| public void unlock(final Runnable taskAfterUnlockBeforeNotify) Implements com. Doc from com. Execute the Then release the lock.
| |
| validateLocked | back to summary |
|---|---|
| public final void validateLocked() throws RuntimeException Implements com.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | holdCount
lock count by same thread |
| private Throwable | lockedStack
stack trace of the lock, only used if DEBUG |
| private int | qsz
queue size of waiting threads |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public final void | |
| public final int | |
| public final Throwable | |
| public final Thread | |
| public final int | |
| public void | |
| public final void | |
| public boolean | isOwner(final Thread t)
Implements jogamp. |
| public final void | |
| public final void | setOwner(final Thread t)
Implements jogamp. |
| holdCount | back to summary |
|---|---|
| private int holdCount lock count by same thread | |
| lockedStack | back to summary |
|---|---|
| private Throwable lockedStack stack trace of the lock, only used if DEBUG | |
| qsz | back to summary |
|---|---|
| private int qsz queue size of waiting threads | |
| SingleThreadSync | back to summary |
|---|---|
| pack-priv SingleThreadSync() | |
| decrHoldCount | back to summary |
|---|---|
| public void decrHoldCount(final Thread t) Implements jogamp.
| |
| decrQSz | back to summary |
|---|---|
| public final void decrQSz() Implements jogamp.
| |
| getHoldCount | back to summary |
|---|---|
| public final int getHoldCount() Implements jogamp.
| |
| getLockedStack | back to summary |
|---|---|
| public final Throwable getLockedStack() Implements jogamp.
| |
| getOwner | back to summary |
|---|---|
| public final Thread getOwner() Implements jogamp.
| |
| getQSz | back to summary |
|---|---|
| public final int getQSz() Implements jogamp.
| |
| incrHoldCount | back to summary |
|---|---|
| public void incrHoldCount(final Thread t) Implements jogamp.
| |
| incrQSz | back to summary |
|---|---|
| public final void incrQSz() Implements jogamp.
| |
| isOwner | back to summary |
|---|---|
| public boolean isOwner(final Thread t) Implements jogamp.
| |
| setLockedStack | back to summary |
|---|---|
| public final void setLockedStack(final Throwable s) Implements jogamp.
| |
| setOwner | back to summary |
|---|---|
| public final void setOwner(final Thread t) Implements jogamp.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public int | |
| public Throwable | |
| public Thread | |
| public int | |
| public void | |
| public void | |
| public boolean | |
| public void | |
| public void |
| decrHoldCount | back to summary |
|---|---|
| public void decrHoldCount(Thread t) | |
| decrQSz | back to summary |
|---|---|
| public void decrQSz() | |
| getHoldCount | back to summary |
|---|---|
| public int getHoldCount() | |
| getLockedStack | back to summary |
|---|---|
| public Throwable getLockedStack() | |
| getOwner | back to summary |
|---|---|
| public Thread getOwner() | |
| getQSz | back to summary |
|---|---|
| public int getQSz() | |
| incrHoldCount | back to summary |
|---|---|
| public void incrHoldCount(Thread t) | |
| incrQSz | back to summary |
|---|---|
| public void incrQSz() | |
| isOwner | back to summary |
|---|---|
| public boolean isOwner(Thread t) | |
| setLockedStack | back to summary |
|---|---|
| public void setLockedStack(Throwable s) | |
| setOwner | back to summary |
|---|---|
| public void setOwner(Thread t) | |