Confirmed users
497
edits
 (Add sections on running, pausing, resuming, and interrupting threads.)  | 
				 (→Interrupting a Thread:  Add "Exiting Threads" section.)  | 
				||
| Line 293: | Line 293: | ||
This indicates that the thread exited before receiving the client's  | This indicates that the thread exited before receiving the client's  | ||
<tt>interrupt</tt> packet, and is now in the <b>Exited</b> state.   | <tt>interrupt</tt> packet, and is now in the <b>Exited</b> state. See  | ||
client should send a <  | [[#Exiting_Threads|Exiting Threads]], below.  | ||
== Exiting Threads ==  | |||
When a thread in the <b>Running</b> state exits, it sends a packet of the following form:  | |||
  { "from":<i>thread</i>, "type":"exited" }  | |||
At this point, the thread can no longer be manipulated by the client, and most of the thread's resources may be freed; however, the thread actor name must remain alive, to handle stray <tt>interrupt</tt> and <tt>detach</tt> packets. To allow the last trace of the thread to be freed, the client should send a packet of the following form:  | |||
  { "to":<i>thread</i>, "type":"release" }  | |||
This allows the thread actor name, <i>thread</i>, to be reused for other actors.  | |||
= Events =  | = Events =  | ||