vibe.d beta banner
get vibe.d
0.10.1

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

Class LocalTaskSemaphore

Thread-local semaphore implementation for tasks.

class LocalTaskSemaphore ;

When the semaphore runs out of concurrent locks, it will suspend. This class is used in vibe.core.connectionpool to limit the number of concurrent connections.

Constructors

NameDescription
this (max_locks)

Properties

NameTypeDescription
available[get] uintNumber of concurrent locks still available
maxLocks[get, set] uintMaximum number of concurrent locks

Methods

NameDescription
lock (priority) Acquires a lock.
tryLock () Try to acquire a lock.
unlock () Gives up an existing lock.
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.