|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.locks.AbstractQueuedSynchronizer
java.util.concurrent.SynchronousQueue.Node
static final class SynchronousQueue.Node
Nodes each maintain an item and handle waits and signals for getting and setting it. The class extends AbstractQueuedSynchronizer to manage blocking, using AQS state 0 for waiting, 1 for ack, -1 for cancelled.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer |
|---|
AbstractQueuedSynchronizer.ConditionObject |
| Field Summary | |
|---|---|
(package private) Object |
item
The item being transferred |
(package private) SynchronousQueue.Node |
next
Next node in wait queue |
| Constructor Summary | |
|---|---|
SynchronousQueue.Node(Object x)
Creates a node with initial item |
|
SynchronousQueue.Node(Object x,
SynchronousQueue.Node n)
Creates a node with initial item and next |
|
| Method Summary | |
|---|---|
(package private) Object |
getItem()
Removes item from slot created by producer and signal producer to continue. |
(package private) boolean |
setItem(Object x)
Fills in the slot created by the consumer and signal consumer to continue. |
protected boolean |
tryAcquire(int ignore)
Implements AQS base acquire to succeed if not in WAITING state |
protected boolean |
tryRelease(int newState)
Implements AQS base release to signal if state changed |
(package private) Object |
waitForPut()
Waits for a producer to put item placed by consumer. |
(package private) Object |
waitForPut(long nanos)
Waits for a producer to put item placed by consumer, or time out. |
(package private) void |
waitForTake()
Waits for a consumer to take item placed by producer. |
(package private) boolean |
waitForTake(long nanos)
Waits for a consumer to take item placed by producer or time out. |
| Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer |
|---|
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, toString, tryAcquireNanos, tryAcquireShared, tryAcquireSharedNanos, tryReleaseShared |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
Object item
SynchronousQueue.Node next
| Constructor Detail |
|---|
SynchronousQueue.Node(Object x)
SynchronousQueue.Node(Object x,
SynchronousQueue.Node n)
| Method Detail |
|---|
protected boolean tryAcquire(int ignore)
tryAcquire in class AbstractQueuedSynchronizerignore - the acquire argument. This value
is always the one passed to an acquire method,
or is the value saved on entry to a condition wait.
The value is otherwise uninterpreted and can represent anything
you like.
protected boolean tryRelease(int newState)
tryRelease in class AbstractQueuedSynchronizernewState - the release argument. This value
is always the one passed to a release method,
or the current state value upon entry to a condition wait.
The value is otherwise uninterpreted and can represent anything
you like.
boolean setItem(Object x)
Object getItem()
void waitForTake()
throws InterruptedException
InterruptedException
Object waitForPut()
throws InterruptedException
InterruptedException
boolean waitForTake(long nanos)
throws InterruptedException
InterruptedException
Object waitForPut(long nanos)
throws InterruptedException
InterruptedException
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||