Module vibe.core.sync
Event loop compatible task synchronization facilities.
This module provides replacement primitives for the modules in core
that do not block vibe.d's event loop in their wait states. These should
always be preferred over the ones in Druntime under usual circumstances.
Using a standard Mutex
is possible as long as it is ensured that no event
loop based functionality (I/O, task interaction or anything that implicitly
calls yield
) is executed within a section of code that is
protected by the mutex. Failure to do so may result in dead-locks and
high-level race-conditions!
Functions
Name | Description |
---|---|
createManualEvent()
|
Creates a new signal that can be shared between fibers. |
createSharedManualEvent()
|
Creates a new signal that can be shared between fibers. |
scopedMutexLock(mutex, mode)
|
Performs RAII based locking/unlocking of a mutex. |
Interfaces
Name | Description |
---|---|
Lockable
|
Classes
Name | Description |
---|---|
InterruptibleRecursiveTaskMutex
|
Alternative to RecursiveTaskMutex that supports interruption.
|
InterruptibleTaskCondition
|
Alternative to TaskCondition that supports interruption.
|
InterruptibleTaskMutex
|
Alternative to TaskMutex that supports interruption.
|
InterruptibleTaskReadWriteMutex
|
Alternative to TaskReadWriteMutex that supports interruption.
|
LocalTaskSemaphore
|
Thread-local semaphore implementation for tasks. |
RecursiveTaskMutex
|
Recursive mutex implementation for tasks. |
TaskCondition
|
Event loop based condition variable or "event" implementation. |
TaskMutex
|
Mutex implementation for fibers. |
TaskReadWriteMutex
|
A ReadWriteMutex implementation for fibers. |
Structs
Name | Description |
---|---|
LocalManualEvent
|
A manually triggered single threaded cross-task event. |
ManualEvent
|
A manually triggered multi threaded cross-task event. |
ScopedMutexLock
|
RAII lock for the Mutex class. |
Enums
Name | Description |
---|---|
LockMode
|