SemaphoreLock class
Scope guard that holds one permit of a semaphore.
- Use
import ThinkMeta.ConcurrentTasks.Synchronization.Semaphore;- Namespace
ThinkMeta::ConcurrentTasks::Synchronization
Syntax
template <SemaphoreType _SemaphoreType>
class [[nodiscard("Discarding a lock guard immediately releases the lock.")]]
SemaphoreLockTemplate parameters
_SemaphoreTypeSemaphoreType- The semaphore type:
SemaphoreorSemaphore_s.
Remarks
Semaphore::Wait on construction (may suspend the calling task), Semaphore::Release of one permit on destruction. Task or converted thread only.
See also
Constructors
SemaphoreLock
Takes one permit (Semaphore::Wait).
Syntax
explicit SemaphoreLock(_SemaphoreType& semaphore) noexcept;Parameters
semaphore_SemaphoreType&- The semaphore; it must outlive the guard.
~SemaphoreLock
Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).