139 void reset(
bool interrupt_waiters = false) noexcept;
153 std::unique_ptr<struct SemaphoreImpl> impl_;
void release(size_t n=1) noexcept
Increments the semaphore counter by n, waking blocked acquirers.
bool acquire(size_t n=1, int timeout_ms=kInfinite) noexcept
Decrements the semaphore counter by n, blocking until permits are available.
void reset(bool interrupt_waiters=false) noexcept
Resets the semaphore counter to zero.
Semaphore(size_t count=0) noexcept
Constructs a Semaphore with an initial counter value.
static constexpr int kInfinite
Sentinel value for acquire() meaning "wait indefinitely".
定义 semaphore.h:87
size_t get_count() const noexcept
Returns the current value of the semaphore counter.
Platform-independent macro definitions for the VLink library.
#define VLINK_EXPORT
定义 macros.h:85
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
定义 macros.h:184