IDisposable| Flags | Name | Summary |
|---|---|---|
| public |
SharedQueue()
|
Construct a fresh, empty SharedQueue. |
| Flags | Name | Summary |
|---|---|---|
| public |
void Close()
|
Close the queue. Causes all waiting threads to be interrupted (with EndOfStreamException) and all further Enqueue() and Dequeue() operations to throw EndOfStreamException. |
| public |
object Dequeue()
|
Retrieve the first item from the queue, or block if none available |
| public |
bool Dequeue(int millisecondsTimeout, out object result)
|
Retrieve the first item from the queue, or return nothing if no items are available after the given timeout |
| public |
object DequeueNoWait(object defaultValue)
|
Retrieve the first item from the queue, or return defaultValue immediately if no items are available |
| public virtual final |
void Dispose()
|
Implement IDisposable.Dispose. Delegates directly to Close(). |
| public |
void Enqueue(object o)
|
Place an item at the end of the queue. |
public
void Close()
| Flags | public |
|---|---|
| Return type |
void
|
public
object Dequeue()
| Flags | public |
|---|---|
| Return type |
object
|
public
bool Dequeue(int millisecondsTimeout, out object result)
| Flags | public | ||||||
|---|---|---|---|---|---|---|---|
| Return type |
bool
|
||||||
| Parameters |
|
If one or more items are present on the queue at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either an item appears on the queue, or millisecondsTimeout milliseconds have elapsed.
Returns true in the case that an item was available before the timeout, in which case the out parameter "result" is set to the item itself.
If no items were available before the timeout, returns false, and sets "result" to null.
A timeout of -1 (i.e. System.Threading.Timeout.Infinite) will be interpreted as a command to wait for an indefinitely long period of time for an item to become available. Usage of such a timeout is equivalent to calling Dequeue() with no arguments. See also the MSDN documentation for System.Threading.Monitor.Wait(object,int).
If, at any time during the call, the queue is in or transitions to a closed state (by a call to Close()), this method will throw EndOfStreamException.
public
object DequeueNoWait(object defaultValue)
| Flags | public | ||||
|---|---|---|---|---|---|
| Return type |
object
|
||||
| Parameters |
|
If one or more objects are present in the queue at the time of the call, the first item is removed from the queue and returned. Otherwise, the defaultValue that was passed in is returned immediately. This defaultValue may be null, or in cases where null is part of the range of the queue, may be some other sentinel object. The difference between DequeueNoWait() and Dequeue() is that DequeueNoWait() will not block when no items are available in the queue, whereas Dequeue() will.
If, at the time of call, the queue is in a closed state (by a call to Close()), this method will throw EndOfStreamException.
public virtual final
void Dispose()
| Flags | public virtual final |
|---|---|
| Return type |
void
|
public
void Enqueue(object o)
| Flags | public | ||||
|---|---|---|---|---|---|
| Return type |
void
|
||||
| Parameters |
|