|
bool | AllReceiversBlocked [get] |
| True if blocking and all receivers are waiting for unblocking.
|
|
bool | IsEmpty [get] |
| True if the queue is empty.
|
|
bool | IsTerminating [get] |
| True if TerminateReceivers has been called.
|
|
Create a new queue with the specified number of receivers.
It is important that the number of receivers is fixed. Properties like AllReceiversBlocked rely on knowing the exact number of receivers using the Pop (or PopNoBlock) methods.
Block queue, all calls to Pop will block until Unblock is called.
Aquires a lock on this queue.
Must be paired with a call to Unlock
Pops the next item off the queue.
This call will block if there are no items in the queue or if the queue is currently blocked.
- Returns
- A Path object, guaranteed to be not null.
- Exceptions
-
Path PopNoBlock |
( |
bool |
blockedBefore | ) |
|
Pops the next item off the queue, this call will not block.
To ensure stability, the caller must follow this pattern. 1. Call PopNoBlock(false), if a null value is returned, wait for a bit (e.g yield return null in a Unity coroutine) 2. try again with PopNoBlock(true), if still null, wait for a bit 3. Repeat from step 2.
- Exceptions
-
Push a path to the end of the queue.
Push a path to the front of the queue.
void ReceiverTerminated |
( |
| ) |
|
Call when a receiver was terminated in other ways than by a QueueTerminationException.
After this call, the receiver should be dead and not call anything else in this class.
void TerminateReceivers |
( |
| ) |
|
All calls to Pop and PopNoBlock will now generate exceptions.
Unblock queue.
Calls to Pop will not block anymore.
- See Also
- Block
Releases the lock on this queue.
ManualResetEvent block = new ManualResetEvent(true) |
|
private |
readonly System.Object lockObj = new System.Object() |
|
private |
readonly int numReceivers |
|
private |
True if blocking and all receivers are waiting for unblocking.
True if the queue is empty.
True if TerminateReceivers has been called.
The documentation for this class was generated from the following file: