◆ adopt()
template<typename ExceptionFactory = semaphore_default_exception_factory, typename Clock = typename timer<>::clock>
The inverse of split(), in which the units held by the specified semaphore_units object are merged into the current one. The function assumes (and asserts) that both are associated with the same semaphore.
- Returns
- the updated semaphore_units object
◆ release()
template<typename ExceptionFactory = semaphore_default_exception_factory, typename Clock = typename timer<>::clock>
Releases ownership of the units. The semaphore will not be signalled.
- Returns
- the number of units held
◆ return_units()
template<typename ExceptionFactory = semaphore_default_exception_factory, typename Clock = typename timer<>::clock>
Return ownership of some units to the semaphore. The semaphore will be signaled by the number of units returned.
- Parameters
-
units | number of units to subtract. |
- Note
- throws exception if
units
is more than those protected by the semaphore
- Returns
- the number of remaining units
◆ split()
template<typename ExceptionFactory = semaphore_default_exception_factory, typename Clock = typename timer<>::clock>
Splits this instance into a semaphore_units object holding the specified amount of units. This object will continue holding the remaining units.
- Parameters
-
units | number of units to subtract. |
- Note
- throws exception if
units
is more than those protected by the semaphore
- Returns
- semaphore_units holding the specified number of units
The documentation for this class was generated from the following file: