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