thread.kill

Syntax thread.kill (id)

Params id is the numeric id of the thread that you wish to terminate.

Action Marks the indicated thread for termination the next time it is swapped in. If the thread is sleeping, it is woken up automatically.

Returns True

Examples thread.kill (104)

   » true

thread.kill (thread.getCurrentID ()); msg ("this won't happen")

   » true

thread.kill (999)

   » error: The thread whose ID is 999 does not exist.

Errors It is an error to specify a nonexistent thread id.

Notes Thread ids can be obtained from other thread verbs, or by examining the system.compiler.threads table.

Killing the current thread is similar to calling scriptError (""), except that it cannot be trapped by a try statement.

If you kill the agent thread, it will be recreated automatically in one second. To stop the agent thread from running, you must call Frontier.enableAgents (false).

See Also thread.evaluate

thread.getNthID

Frontier.enableAgents

system.compiler.threads

Discuss