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

API reference / Core

ITask interface

A unit of work the scheduler runs on one of its fibers.

On this page
Use
#include <ThinkMeta.ConcurrentTasks/Core.h>
Namespace
ThinkMeta::ConcurrentTasks
Inherits
INotifyTaskStateChange
Platforms
Windows, Linux

Syntax

Remarks

The object is owned by the caller and must stay alive from ITaskScheduler::AddTask until its INotifyTaskStateChange::OnTaskExited has been called.

See also

Tasks::Task

Methods

Run

The task's body.

Syntax

virtual void Run() noexcept = 0;

Remarks

Run once per ITaskScheduler::AddTask on a scheduler thread. It may suspend (wait on synchronization primitives), yield and sleep; the thread runs other tasks meanwhile.

SetNotifyCallback

Sets the object that is told when the task exits.

Syntax

virtual void SetNotifyCallback(
    INotifyTaskStateChange* notifyTaskStateChange
) noexcept = 0;

Parameters

notifyTaskStateChangeINotifyTaskStateChange*
The observer, borrowed: it must stay valid until the task has exited. nullptr: none.

Remarks

The core never calls it; it lets code that did not create the task observe its end (see Tasks::Task).

See also

INotifyTaskStateChange::OnTaskExited

GetControlData

Returns the task's control data.

Syntax

virtual TaskControlData* GetControlData() noexcept;

Return value

Type: TaskControlData*

Storage owned by the task object and valid as long as it lives, or nullptr (the default) if the task brings none and so cannot be started by time.

Remarks

Needed only to start the task by time (ITaskScheduler::AddTimedTask): a task that has not started has no task context yet. A task that returns nullptr - one without state, say - cannot be started by time; it can still sleep and wait with a timeout.

See also

TaskControlData

Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).