DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B3020: potentially blocking operation in a protected action

Catalog status: active. Default severity: error. Stable name: potentially-blocking. Family: Flow and effects.

A protected action (one of a protected object's procedures, functions or entry bodies) holds the object's lock until it returns. It must not wait while it does (RM 9.5.1(18)): no delay, and no call of an entry, which may wait for its barrier, however indirectly. Verada follows every call the action makes.

Example (Vada)

   protected body Gate is
      procedure Pass is
      begin
         delay 0.1;     --  every other task that uses Gate waits too
      end Pass;
   end Gate;

Example (Varc)

    protected body Gate {
        fn Pass() {
            delay 0.1;     // every other task that uses Gate waits too
        }
    }

What to do

Move the delay or the entry call out of the protected object, into the task that calls its operation.

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.