Seastar
High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::semaphore_units< ExceptionFactory, Clock > Class Template Reference

Public Member Functions

 semaphore_units (basic_semaphore< ExceptionFactory, Clock > &sem, size_t n) noexcept
 
 semaphore_units (semaphore_units &&o) noexcept
 
semaphore_unitsoperator= (semaphore_units &&o) noexcept
 
 semaphore_units (const semaphore_units &)=delete
 
size_t release ()
 
semaphore_units split (size_t units)
 
void adopt (semaphore_units &&other) noexcept
 

Member Function Documentation

◆ adopt()

template<typename ExceptionFactory = semaphore_default_exception_factory, typename Clock = typename timer<>::clock>
void seastar::semaphore_units< ExceptionFactory, Clock >::adopt ( semaphore_units< ExceptionFactory, Clock > &&  other)
inlinenoexcept

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>
size_t seastar::semaphore_units< ExceptionFactory, Clock >::release ( )
inline

Releases ownership of the units. The semaphore will not be signalled.

Returns
the number of units held

◆ split()

template<typename ExceptionFactory = semaphore_default_exception_factory, typename Clock = typename timer<>::clock>
semaphore_units seastar::semaphore_units< ExceptionFactory, Clock >::split ( size_t  units)
inline

Splits this instance into a semaphore_units object holding the specified amount of units. This object will continue holding the remaining units.

noexcept if units <= _n

Returns
semaphore_units holding the specified number of units

The documentation for this class was generated from the following file: