Manages a background thread to execute queued actions.
More...
|
void | Flush () |
| Blocks the caller until the background thread has finished processing the queue. More...
|
|
bool | Flush (int timeoutMs) |
| Blocks the caller until the background thread has finished processing the queue, or until the specified timeout has elapsed. More...
|
|
bool | Flush (int timeoutMs, bool exitContext) |
| Blocks the caller until the background thread has finished processing the queue, or until the specified timeout has elapsed. More...
|
|
void | Dispose () |
| Terminates the background thread. Does not flush the queue. More...
|
|
Manages a background thread to execute queued actions.
◆ ThreadedActionQueue()
VolumeControl.Log.Helpers.ThreadedActionQueue.ThreadedActionQueue |
( |
| ) |
|
|
protected |
◆ Dispose()
void VolumeControl.Log.Helpers.ThreadedActionQueue.Dispose |
( |
| ) |
|
Terminates the background thread. Does not flush the queue.
◆ Enqueue()
void VolumeControl.Log.Helpers.ThreadedActionQueue.Enqueue |
( |
Action |
action | ) |
|
|
protected |
◆ Flush() [1/3]
void VolumeControl.Log.Helpers.ThreadedActionQueue.Flush |
( |
| ) |
|
Blocks the caller until the background thread has finished processing the queue.
◆ Flush() [2/3]
bool VolumeControl.Log.Helpers.ThreadedActionQueue.Flush |
( |
int |
timeoutMs | ) |
|
Blocks the caller until the background thread has finished processing the queue, or until the specified timeout has elapsed.
- Parameters
-
timeoutMs | How many milliseconds to wait before returning early, or (-1) to wait indefinitely. |
- Returns
true
when the queue was successfully flushed before timing out; otherwise false
.
◆ Flush() [3/3]
bool VolumeControl.Log.Helpers.ThreadedActionQueue.Flush |
( |
int |
timeoutMs, |
|
|
bool |
exitContext |
|
) |
| |
Blocks the caller until the background thread has finished processing the queue, or until the specified timeout has elapsed.
- Parameters
-
timeoutMs | How many milliseconds to wait before returning early, or (-1) to wait indefinitely. |
exitContext | true to exit the synchronization domain for the context before waiting & reacquire it afterwards; otherwise, false .
For more information, see this StackOverflow answer. |
- Returns
true
when the queue was successfully flushed before timing out; otherwise false
.
The documentation for this class was generated from the following file: