DEVELOPMENT EDITION · 769442725406
Library Reference
On this page

Verada.Tasking

Public Stop plus compiler-generated task/protected runtime hooks.

Read the family guide for representation, selection and resource rules. The complete declaration page retains exact signatures/contracts; the source specification is the implementation baseline.

Availability and ownership

Programs call Stop, which ends every task; the other operations are what the compiler generates for tasks, protected objects and delays. Delay_For's precondition limits a delay to one day.

A client proof uses these contracts without proving the body again (see library assurance). Global => null excludes package-global effects, not changes made through an in out argument.

Import and instantiate

with Verada.Tasking;
import Verada.Tasking;

A Vibe module imports this unit's names with from Verada.Tasking import Name; see library use across syntaxes. In Varc, keep each name's declared spelling and write & on arguments the call changes.

Contract and lifecycle reading

A Pre condition is the caller's obligation; a Post is what a normal return guarantees. What a postcondition does not state, a client cannot assume. Ghost functions are for contracts and ghost code. The family guide describes copying, lifetime, order and cost.

API 001

Task_Body (declaration) — Access-to-procedure callback type used by generated task activation; use structured task declarations instead of directly registering arbitrary callbacks.

Declared interface:

type Task_Body is access procedure;

API 002

Start (declaration) — Compiler-support registration of a task body for activation after library elaboration; use structured task syntax.

API 003

Stop (declaration) — End every other task, and the caller too when it is a task; the program ends once its main subprogram returns.

API 004

Lock_Id (declaration) — Integer-derived token for the runtime protected-lock table. Structured protected syntax supplies matching allocation/locking/barrier operations.

Declared interface:

type Lock_Id is new Integer;

API 005

New_Lock (declaration) — Compiler-support allocation of a protected-object lock from the finite runtime table.

API 006

Lock (declaration) — Compiler-support lock acquisition; arbitrary direct calls do not inherit structured protected-action proof discipline.

API 007

Unlock (declaration) — Compiler-support release of a previously acquired protected lock.

API 008

Wait (declaration) — Compiler-support condition wait for an entry barrier; releases the lock while waiting.

API 009

Notify (declaration) — Compiler-support notification of barrier waiters after a protected action.

API 010

Delay_Until (declaration) — Wait until the supported monotonic Time value; actual scheduling can wake later.

API 011

Delay_For (declaration) — Wait for at least the relative Duration, to the nanosecond above it, however long it is.

API 012

Attach (declaration) — Compiler support for Attach_Handler: attaches a protected procedure to an interrupt as its package is elaborated; the run-time calls it, under its lock, each time the interrupt (a POSIX signal) occurs after activation.

Declared interface:

function Attach (Interrupt : Integer; Handler : Task_Body) return Boolean
  with Import, Convention => Ada, External_Name => "verada_rt_attach_handler", Global => null;