EDU.oswego.cs.dl.util.concurrent
public class SynchronousChannel extends Object implements BoundedChannel
If you only need threads to synch up without exchanging information, consider using a Barrier. If you need bidirectional exchanges, consider using a Rendezvous.
[ Introduction to this package. ]
See Also: CyclicBarrier
| Nested Class Summary | |
|---|---|
| protected static class | SynchronousChannel.Queue
Simple FIFO queue class to hold waiting puts/takes.
|
| Field Summary | |
|---|---|
| protected static Object | CANCELLED
Special marker used in queue nodes to indicate that
the thread waiting for a change in the node has timed out
or been interrupted.
|
| protected SynchronousChannel.Queue | waitingPuts |
| protected SynchronousChannel.Queue | waitingTakes |
| Method Summary | |
|---|---|
| int | capacity() |
| boolean | offer(Object x, long msecs) |
| Object | peek() |
| Object | poll(long msecs) |
| void | put(Object x) |
| Object | take() |
Returns: zero -- Synchronous channels have no internal capacity.
Returns: null -- Synchronous channels do not hold contents unless actively taken