vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Module vibe.core.sync

Event loop compatible task synchronization facilities.

This module provides replacement primitives for the modules in core.sync 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

NameDescription
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

NameDescription
Lockable

Classes

NameDescription
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

NameDescription
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

NameDescription
LockMode
Authors

Leonid Kramer, Sönke Ludwig, Manuel Frischknecht

Copyright

© 2012-2019 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.