Functions and constants functions
Free functions and constants of Synchronization.
On this page
- Use
import ThinkMeta.ConcurrentTasks.Synchronization.AutoResetEvent;- Namespace
ThinkMeta::ConcurrentTasks::Synchronization- Platforms
- Windows, Linux
Functions
Synchronization::Await
Starts an asynchronous operation and waits until it reports its completion.
Syntax
template <typename Start> void Await(Start&& start);Template parameters
Starttypename- A callable that takes a
Completionby reference.
Parameters
startStart&&- Starts the operation, or registers for its completion, and hands the
Completionto the operation's callback, as a copy or by address: the referenced object stays valid untilAwaitreturns.
Remarks
Suspends the calling task until the completion is called; the scheduler thread runs other tasks meanwhile. The completion may be called before start returns. It must be called exactly once, also when the operation fails or is canceled; the result and any error are fetched from the operation after the wait. Task or converted thread only. If start throws, the completion must not be called any more. There is no timed variant: a timed-out wait would leave the callback behind with a reference to the task's stack. Limit the time with the operation itself, for example by canceling it.
See also
Concepts
Synchronization::AutoResetEventType
Matches the auto-reset event types of this module.
Syntax
template <typename T>
concept AutoResetEventType =
std::same_as<T, AutoResetEvent>
|| std::same_as<T, AutoResetEvent_s>;Template parameters
Ttypename- The candidate type.
Remarks
Satisfied by AutoResetEvent and AutoResetEvent_s.
See also
Synchronization::CriticalSectionType
Matches the critical section types of this module.
Syntax
template <typename T>
concept CriticalSectionType =
std::same_as<T, CriticalSection>
|| std::same_as<T, CriticalSection_s>;Template parameters
Ttypename- The candidate type.
Remarks
Satisfied by CriticalSection and CriticalSection_s.
See also
Synchronization::ManualResetEventType
Matches the manual-reset event types of this module.
Syntax
template <typename T>
concept ManualResetEventType =
std::same_as<T, ManualResetEvent>
|| std::same_as<T, ManualResetEvent_s>;Template parameters
Ttypename- The candidate type.
Remarks
Satisfied by ManualResetEvent and ManualResetEvent_s.
See also
Synchronization::SemaphoreType
Matches the semaphore types of this module.
Syntax
template <typename T>
concept SemaphoreType = std::same_as<T, Semaphore> || std::same_as<T, Semaphore_s>;Template parameters
Ttypename- The candidate type.
Remarks
Satisfied by Semaphore and Semaphore_s.
See also
Synchronization::TaskGroupType
Matches the task group types of this module.
Syntax
template <typename T>
concept TaskGroupType = std::same_as<T, TaskGroup> || std::same_as<T, TaskGroup_s>;Template parameters
Ttypename- The candidate type.
Remarks
Satisfied by TaskGroup and TaskGroup_s.
See also
Synchronization::WaitableType
Matches types that provide the waitable interface.
Syntax
template <typename T> concept WaitableType = requires(T& w);Template parameters
Ttypename- The candidate type.
Synchronization::TimedWaitableType
Matches types that provide the waitable task interface with timeouts.
Syntax
template <typename T>
concept TimedWaitableType = WaitableType<T> && requires(T& w, Duration timeout);Template parameters
Ttypename- The candidate type.
Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).