Preliminary. ThinkMeta ConcurrentTasks and this documentation are preliminary; everything is subject to change.

API reference / Synchronization

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.")]]
    CriticalSectionLock

Template parameters

_CriticalSectionTypeCriticalSectionType
The critical section type: CriticalSection or CriticalSection_s.

Remarks

CriticalSection::Enter on construction (may suspend the calling task), CriticalSection::Leave on destruction. Task or converted thread only.

See also

SpinCriticalSectionLock

Constructors

CriticalSectionLock

Enters the critical section.

Syntax

explicit CriticalSectionLock(_CriticalSectionType& criticalSection) noexcept;

Parameters

criticalSection_CriticalSectionType&
The critical section; it must outlive the guard.

~CriticalSectionLock

Leaves the critical section.

Syntax

~CriticalSectionLock() noexcept;

Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).