v2026.11.2
All Bundles
Bundle

System support for threads and runtime concurrency

TaskScope

A structured-concurrency scope (nursery). Spawn child tasks, then JoinAll() -- ideally from a `leaving { scope->JoinAll(); }` block so all children are joined on every exit path (normal, early return, or unwind).

Operations

Cancel #

Request cooperative cancellation; tasks not yet started will skip their body.

method : public : Cancel() ~ Nil

FirstError #

The first child error observed (by convention, a non-Nil result a body chose to report as an error). Nil if none.

method : public : FirstError() ~ System.Base

IsCancelled #

True if the scope has been cancelled.

method : public : IsCancelled() ~ Bool

JoinAll #

Join every child task. Routes through THREAD_JOIN, so the caller is counted as parked for GC stop-the-world -- the collector's root set stays complete.

method : public : JoinAll() ~ Nil

Size #

Number of children spawned in this scope.

method : public : Size() ~ Int

Spawn #

Spawn a closure as a child task on its own Thread; returns the Task handle.

method : public : Spawn() ~ Task

Parameters

NameTypeDescription