|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.util.backport.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.
| Field Summary | |
|---|---|
(package private) Object |
item
The item being transferred |
(package private) SynchronousQueue.Node |
next
Next node in wait queue |
(package private) int |
state
|
| 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. |
(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.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
int state
Object item
SynchronousQueue.Node next
| Constructor Detail |
|---|
SynchronousQueue.Node(Object x)
SynchronousQueue.Node(Object x,
SynchronousQueue.Node n)
| Method Detail |
|---|
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||