DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B3029: a suspension object more than one task may wait on

Catalog status: active. Default severity: error. Stable name: suspension-waiters. Family: Flow and effects.

A suspension object (Ada.Synchronous_Task_Control) lets one task wait until another sets it true. Under Ravenscar and Jorvik, which Verada's tasking follows, a second task calling Suspend_Until_True on an object another task is already waiting on raises Program_Error (RM D.10(10)). Verada proves that cannot happen by checking that each library-level suspension object is waited on by one task at most (or by the main subprogram), counting calls made through subprograms that are given the object as a parameter.

Example (Vada)

   Go : Suspension_Object;
   task First;
   task Second;
   ...
   task body First is
   begin
      Suspend_Until_True (Go);
      ...
   task body Second is
   begin
      Suspend_Until_True (Go);

What to do (Vada)

Give each waiting task a suspension object of its own, and set each one:

   Go_First, Go_Second : Suspension_Object;

Regression source and further reading

Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.

See flow and effects, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.