Asynchronous counting semaphore for cooperative coroutine concurrency throttling.
More...
#include <Semaphore.hpp>
Asynchronous counting semaphore for cooperative coroutine concurrency throttling.
◆ AsyncSemaphore() [1/2]
| constexpr corium::async::AsyncSemaphore::AsyncSemaphore |
( |
ptrdiff_t |
initialCount = 1 | ) |
|
|
inlineexplicitconstexprnoexcept |
Construct semaphore with initial available count.
- Parameters
-
| initialCount | Number of initial available permits. |
◆ ~AsyncSemaphore()
| corium::async::AsyncSemaphore::~AsyncSemaphore |
( |
| ) |
|
|
default |
◆ AsyncSemaphore() [2/2]
| corium::async::AsyncSemaphore::AsyncSemaphore |
( |
const AsyncSemaphore & |
| ) |
|
|
delete |
◆ acquire()
Acquire a permit asynchronously (suspends coroutine until permit is released).
◆ available()
| ptrdiff_t corium::async::AsyncSemaphore::available |
( |
| ) |
const |
|
inlinenoexcept |
◆ operator=()
◆ release()
| void corium::async::AsyncSemaphore::release |
( |
ptrdiff_t |
update = 1 | ) |
|
|
inlinenoexcept |
Release one or more permits and resume waiting coroutines.
- Parameters
-
| update | Number of permits to return (default: 1). |
◆ tryAcquire()
| bool corium::async::AsyncSemaphore::tryAcquire |
( |
| ) |
|
|
inlinenoexcept |
Non-blocking attempt to acquire a permit.
- Returns
- true if permit acquired; false if semaphore count is zero.
The documentation for this class was generated from the following file: