This example was provided by Ian Smith (ROE). When the controlling task receives a CANCEL, it sends a CANCEL to the subsidiary task. The controlling task then requests ACT__MESSAGE to wait for the final acknowledgement from the OBEY in the subsidiary task. The final completion status from the subsidiary task is obtained by the controlling task by the call to TASK_GET_REASON, irrespective of whether the final completion was due to a CANCEL.
ADAM Guide to Writing Instrumentation Tasks