Package org.jgroups.protocols
Class Locking.ClientCondition
- java.lang.Object
-
- org.jgroups.protocols.Locking.ClientCondition
-
- All Implemented Interfaces:
java.util.concurrent.locks.Condition
- Enclosing class:
- Locking
protected class Locking.ClientCondition extends java.lang.Object implements java.util.concurrent.locks.Condition
-
-
Field Summary
Fields Modifier and Type Field Description protected Locking.ClientLock
lock
protected java.util.concurrent.atomic.AtomicReference<java.lang.Thread>
parker
This is okay only having 1 since a client condition is 1 per lock_name, thread id combination.protected java.util.concurrent.atomic.AtomicBoolean
signaled
-
Constructor Summary
Constructors Constructor Description ClientCondition(Locking.ClientLock lock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
await()
protected void
await(boolean throwInterrupt)
protected long
await(long nanoSeconds)
boolean
await(long time, java.util.concurrent.TimeUnit unit)
Note this wait will only work correctly if the converted value is less than 292 years.long
awaitNanos(long nanosTimeout)
void
awaitUninterruptibly()
boolean
awaitUntil(java.util.Date deadline)
void
signal()
void
signalAll()
protected void
signaled()
-
-
-
Field Detail
-
lock
protected final Locking.ClientLock lock
-
signaled
protected final java.util.concurrent.atomic.AtomicBoolean signaled
-
parker
protected volatile java.util.concurrent.atomic.AtomicReference<java.lang.Thread> parker
This is okay only having 1 since a client condition is 1 per lock_name, thread id combination.
-
-
Constructor Detail
-
ClientCondition
public ClientCondition(Locking.ClientLock lock)
-
-
Method Detail
-
await
public void await() throws java.lang.InterruptedException
- Specified by:
await
in interfacejava.util.concurrent.locks.Condition
- Throws:
java.lang.InterruptedException
-
awaitUninterruptibly
public void awaitUninterruptibly()
- Specified by:
awaitUninterruptibly
in interfacejava.util.concurrent.locks.Condition
-
awaitNanos
public long awaitNanos(long nanosTimeout) throws java.lang.InterruptedException
- Specified by:
awaitNanos
in interfacejava.util.concurrent.locks.Condition
- Throws:
java.lang.InterruptedException
-
await
public boolean await(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Note this wait will only work correctly if the converted value is less than 292 years. This is due to the limitation in System.nano and long values that can only store up to 292 years (2263 nanoseconds). For more information please seeSystem.nanoTime()
- Specified by:
await
in interfacejava.util.concurrent.locks.Condition
- Throws:
java.lang.InterruptedException
-
awaitUntil
public boolean awaitUntil(java.util.Date deadline) throws java.lang.InterruptedException
- Specified by:
awaitUntil
in interfacejava.util.concurrent.locks.Condition
- Throws:
java.lang.InterruptedException
-
await
protected void await(boolean throwInterrupt) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
await
protected long await(long nanoSeconds) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
signal
public void signal()
- Specified by:
signal
in interfacejava.util.concurrent.locks.Condition
-
signalAll
public void signalAll()
- Specified by:
signalAll
in interfacejava.util.concurrent.locks.Condition
-
signaled
protected void signaled()
-
-