ThreadCallbackProc alias
Called on each scheduler thread when it starts and when it exits.
- Use
#include <ThinkMeta.ConcurrentTasks/Core.h>- Namespace
ThinkMeta::ConcurrentTasks- Platforms
- Windows, Linux
Syntax
using ThreadCallbackProc =
void (*)(
ITaskScheduler* taskScheduler,
std::uint32_t threadIndex,
NativeThread thread,
void* context,
ThreadCallbackReason reason
) noexcept;Parameters
taskSchedulerITaskScheduler*- The scheduler the thread belongs to.
threadIndexstd::uint32_t- 0-based index of the thread within its scheduler.
threadNativeThread- The scheduler thread's native handle: on Windows a
HANDLEwith full access, owned by the scheduler and valid until it is destroyed (duplicate it to keep it longer); elsewhere thepthread_t. contextvoid*SchedulerInfo::threadCallbackContext.reasonThreadCallbackReason- See
ThreadCallbackReason.
Remarks
Use it e.g. to set thread affinity, priority or thread-local state. Runs on the plain OS thread, not in a task: it must not use the synchronization primitives or the task functions. Only the SchedulerKind::Default scheduler calls it.
See also
Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).