vibe.d beta banner
get vibe.d
0.10.1

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

Class TaskMutex

Mutex implementation for fibers.

class TaskMutex
  : core.sync.mutex.Mutex
  , Lockable ;

This mutex type can be used in exchange for a core.sync.mutex.Mutex, but does not block the event loop when contention happens. Note that this mutex does not allow recursive locking.

Constructors

NameDescription
this (o)
this ()
this (o)
this ()

Methods

NameDescription
lock ()
lock (timeout)
lock ()
lock (timeout)
tryLock ()
tryLock ()
unlock ()
unlock ()
lock ()
tryLock ()
unlock ()

Notice

Because this class is annotated nothrow, it cannot be interrupted using Task.interrupt(). The corresponding InterruptException will be deferred until the next blocking operation yields the event loop.

Use InterruptibleTaskMutex as an alternative that can be interrupted.

See Also

InterruptibleTaskMutex, RecursiveTaskMutex, core.sync.mutex.Mutex

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.