CriticalSectionLock class
Scope guard that holds a critical section.
- Use
import ThinkMeta.ConcurrentTasks.Synchronization.CriticalSection;- Namespace
ThinkMeta::ConcurrentTasks::Synchronization
Syntax
template <CriticalSectionType _CriticalSectionType>
class [[nodiscard("Discarding a lock guard immediately releases the lock.")]]
CriticalSectionLockTemplate parameters
_CriticalSectionTypeCriticalSectionType- The critical section type:
CriticalSectionorCriticalSection_s.
Remarks
CriticalSection::Enter on construction (may suspend the calling task), CriticalSection::Leave on destruction. Task or converted thread only.
See also
Constructors
CriticalSectionLock
Enters the critical section.
Syntax
explicit CriticalSectionLock(_CriticalSectionType& criticalSection) noexcept;Parameters
criticalSection_CriticalSectionType&- The critical section; it must outlive the guard.
~CriticalSectionLock
Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).