| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
<html> |
| 16 |
<head> |
| 17 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 18 |
<meta http-equiv="Content-Language" content="en-us"> |
| 19 |
<title>killed</title> |
| 20 |
</head> |
| 21 |
<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258"> |
| 22 |
<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top> |
| 23 |
<tr> |
| 24 |
<td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td> |
| 25 |
</tr> |
| 26 |
</table> |
| 27 |
<table border="0" align="right" cellpadding="0" cellspacing="0"> |
| 28 |
<tr> |
| 29 |
<td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td> |
| 30 |
<td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td> |
| 31 |
<td><a href="kill.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> |
| 32 |
<td><a href="label.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td> |
| 33 |
</tr> |
| 34 |
</table> |
| 35 |
<p><br clear="all"> |
| 36 |
</p> |
| 37 |
<hr> |
| 38 |
<h1>killed</h1> |
| 39 |
<hr align="left" width="75%"> |
| 40 |
<p>The operation is used to wait for (a) given parallel test component(s) to terminate execution. |
| 41 |
<ul> |
| 42 |
<li>Used as a stand-alone statement, it blocks program execution until the component finishes executing the function.</li> |
| 43 |
<li>Used in the body of an <a href="alt.html"><b><font face="Courier New" color="#003258" size="4">alt</font></b></a> statement, it does not block TTCN-3 program execution, i.e., it reflects |
| 44 |
the momentarily state of the component.</li> |
| 45 |
<li><a name="stop_all">The</a> keyword <a href="any.html"><b><font face="Courier New" color="#003258" size="4">any</font></b></a> is used if it <a href="#any">does not |
| 46 |
matter which component</a> terminates executiuon.</li> |
| 47 |
<li><a name="stop_all">The</a> keyword <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a> |
| 48 |
<li>The killed operation can address parallel test components only.</li> |
| 49 |
</ul> |
| 50 |
<p>The killed operation means the same for both normal and alive parallel test components. |
| 51 |
<p>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. |
| 52 |
<p>Related keywords:</p> |
| 53 |
<ul> |
| 54 |
<li><a href="alive.html"><b><font face="Courier New" color="#003258" size="4">alive</font></b></a> |
| 55 |
<li><a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a></li> |
| 56 |
<li><a href="alt.html"><b><font face="Courier New" color="#003258" size="4">alt</font></b></a></li> |
| 57 |
<li><a href="any.html"><b><font face="Courier New" color="#003258" size="4">any</font></b></a></li> |
| 58 |
<li><a href="component.html"> <b><font face="Courier New" color="#003258" size="4">component</font></b> </a></li> |
| 59 |
<li><a href="create.html"><b><font face="Courier New" color="#003258" size="4">create</font></b></a> |
| 60 |
<li><a href="done.html"><b><font face="Courier New" color="#003258" size="4">done</font></b></a> |
| 61 |
<li><a href="kill.html"><b><font face="Courier New" color="#003258" size="4">kill</font></b></a> |
| 62 |
<li><a href="running.html"><b><font face="Courier New" color="#003258" size="4">running</font></b></a> |
| 63 |
<li><a href="stop.html"><b><font face="Courier New" color="#003258" size="4">stop</font></b></a></li> |
| 64 |
</ul> |
| 65 |
<hr align="left" width="50%"> |
| 66 |
<div align="center"> |
| 67 |
<center> |
| 68 |
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> |
| 69 |
<tr> |
| 70 |
<td width="100%"> |
| 71 |
<h3 align="center"><i>component_reference</i><font face="Courier New" color="#003258" size="5"><b>.killed;</b></font> </h3> |
| 72 |
</td> |
| 73 |
</tr> |
| 74 |
</table> |
| 75 |
</center> |
| 76 |
</div> |
| 77 |
<ul> |
| 78 |
<li> |
| 79 |
<p>The <i>component_reference</i> is one of the following:</p> |
| 80 |
<ul> |
| 81 |
<li>a reference returned by the <a href="create.html"><b><font face="Courier New" color="#003258" size="4">create</font></b></a> operation to refer to a given parallel test |
| 82 |
component,</li> |
| 83 |
<li>the keyword pair <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a> <a href="component.html"> <b><font |
| 84 |
face="Courier New" color="#003258" size="4">component</font></b> </a> to check whether all parallel test components have finished execution,</li> |
| 85 |
<li> |
| 86 |
<p>the keyword pair <a href="mtc.html"><b><font face="Courier New" color="#003258" size="4">any</font></b></a> <a href="component.html"> <b><font |
| 87 |
face="Courier New" color="#003258" size="4">component</font></b></a> to check whether at least one parallel test has finished execution.</p> |
| 88 |
</li> |
| 89 |
</ul> |
| 90 |
</li> |
| 91 |
<li> |
| 92 |
<p>The <b><font face="Courier New" color="#003258" size="4">killed</font> </b>keyword denotes that (a) component(s) should be checked.</p> |
| 93 |
</li> |
| 94 |
</ul> |
| 95 |
<hr align="left" width="50%"> |
| 96 |
<p><a href="#Example 1a">Examples</a></p> |
| 97 |
<hr align="left" width="75%"> |
| 98 |
<p><a name="Example 1a:">Example 1a</a></p> |
| 99 |
<p><font face="Courier New">vc_AncienVolcan.killed;<br> |
| 100 |
</font> |
| 101 |
<p>The program execution is suspended until the component with reference vc_AncienVolcan has terminated (i.e. killed).</p> |
| 102 |
<hr align="left" width="50%"> |
| 103 |
<p><a name="all">Example</a> 1b:</p> |
| 104 |
<p><font face="Courier New"> all component.killed;</font> |
| 105 |
<p>The program execution is suspended until all parallel components terminated.</p> |
| 106 |
<hr align="left" width="50%"> |
| 107 |
<p><a name="any">Example</a> 1c:</p> |
| 108 |
<p><font face="Courier New">[] any component.killed { ⦠}; <br> |
| 109 |
</font> |
| 110 |
<p>This alternative in the alt statement will be invoked when any of the components has just been terminated.</p> |
| 111 |
<hr align="left" width="25%"> |
| 112 |
<p><a name="Example 2:">Example 2</a></p> |
| 113 |
<p><font face="Courier New"> var PTCType_CT vc_myAlivePtc := PTCType_CT.create alive;<br> |
| 114 |
vc_myAlivePtc.start(f_myPtcFunction1());<br> |
| 115 |
vc_myAlivePtc.done;<br> |
| 116 |
vc_myAlivePtc.start(f_myPtcFunction2());<br> |
| 117 |
vc_myAlivePtc.killed;<br> |
| 118 |
</font> |
| 119 |
<p>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 |
| 120 |
componenent being killed only. Exchanging the done with killed would wait for <code>vc_myAlivePtc</code> to be killed, which must happen externally, and then exit with error for the 2nd start |
| 121 |
operation as when a component is killed it cannot be used to execute functions any more. |
| 122 |
<hr align="left" width="25%"> |
| 123 |
<p><a HREF="BNF.html#killedstatement">BNF definition</a> of <font face="Courier New">killed</font></p> |
| 124 |
</body> |
| 125 |
</html> |