Titan



killed


The operation is used to wait for (a) given parallel test component(s) to terminate execution.

The killed operation means the same for both normal and alive parallel test components.

When a parallel test component is killed then it is also done (i.e. done operation does not block), not running and not alive (i.e. both running and alive operations return false), neither.

Related keywords:


component_reference.killed;  


Examples


Example 1a

vc_AncienVolcan.killed;

The program execution is suspended until the component with reference vc_AncienVolcan has terminated (i.e. killed).


Example 1b:

all component.killed;

The program execution is suspended until all parallel components terminated.


Example 1c:

[] any component.killed { … }; 

This alternative in the alt statement will be invoked when any of the components has just been terminated.


Example 2

var PTCType_CT vc_myAlivePtc := PTCType_CT.create alive;
vc_myAlivePtc.start(f_myPtcFunction1());
vc_myAlivePtc.done;
vc_myAlivePtc.start(f_myPtcFunction2());
vc_myAlivePtc.killed;

The above example shows the difference between the use of done and killed operations. While done waits for a component for being finished, stopped or killed, the killed operation waits for the componenent being killed only. Exchanging the done with killed would wait for vc_myAlivePtc to be killed, which must happen externally, and then exit with error for the 2nd start operation as when a component is killed it cannot be used to execute functions any more.


BNF definition of killed