-
Notifications
You must be signed in to change notification settings - Fork 0
Queue
Karl F. A. Friebel edited this page Jan 22, 2019
·
2 revisions
A Queue represents a virtual queue of awaiters. It is, in essence, a standard mutex implementation.
Regard to Lock to see why a mutex is not quite the same as a C# lock statement.
You can create a Queue using standard new construction.
You can check the status of the queue using IsEmpty.
Awaiting a Queue means waiting for your turn. As soon as you reach the head of the queue, which may be immediately if the queue is empty, the await will return. When you want to indicate that you finished your turn, dispose the returned SynchronizationHandle. Your successor will then be moved to the head of the queue. Waiting can also be canceled at any point, in which case you cede your turn to your successor.