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

API reference / Core

ISuspendCallback interface

Receives the handle of the task that has just been suspended.

Use
#include <ThinkMeta.ConcurrentTasks/Core.h>
Namespace
ThinkMeta::ConcurrentTasks

Syntax

See also

SuspendTask, SuspendTaskFor

Methods

OnSuspended

Called once the suspending task is off the processor.

Syntax

virtual void OnSuspended(SuspendedTask suspendedTask) noexcept = 0;

Parameters

suspendedTaskSuspendedTask
The task's handle. The waiter publishes it here (e.g. pushes it onto its wait list) or, if the condition it waits for has already come true, passes it straight to ResumeTask.

Remarks

Runs on the scheduler thread, outside any task (for a converted thread: on that thread, before it blocks), so it must not suspend, yield or wait. From the moment the handle is published a resumer on another thread may resume the task, so the callback must not touch the waiter's state after publishing unless it knows the task cannot run yet.

See also

OnTimeout

OnTimeout

Called when a SuspendTaskFor times out.

Syntax

virtual bool OnTimeout(SuspendedTask suspendedTask) noexcept;

Parameters

suspendedTaskSuspendedTask
The handle OnSuspended received for this suspension; the waiter removes it from where it was published if it is still there.

Return value

Type: bool

true if the waiter took the task back from wherever OnSuspended published it: the core then resumes it as timed out. false if a resumer took the task first; the core then waits for that resumer's ResumeTask.

Remarks

Called by the core's timer thread while the task is still suspended. Must be short and must not resume the task itself.

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