Method Thread():quit() Foundation

Terminate the thread of this thread object

:quit( [<xResult>], [<nRestart>] ) --> NIL
Optionally any value <xResult> can be passed to the method which is assigned as return value of the thread to the :result instance variable.
Constants from the following table can be used for <nRestart>. They are defined in THREAD.CH.
Constants for the termination of a thread
Constant Description
QUIT_NORESTART *) The instance variable :interval is set to NIL before the thread is terminated
QUIT_RESTART The instance variable :interval remains unchanged
  1. Default

The return value is always NIL.


The :quit() method immediately terminates execution of program code of the threead of this thread object. Before the thread returns, the :atEnd() method is called and the program code defined by :atEnd is executed, if specified. The :quit() method is special in the Thread class because it can be called only for that Thread object which maintains the current thread. This is equivalent to the expression ThreadObject():quit(). It is not possible to use :quit() for terminating a thread directly from another thread. Terminating a running thread from outside can only be done indirectly.

If a time interval is set on the corresponding Thread object (see :setInterval()) and QUIT_RESTART is passed to :quit(), only the current execution cycle is terminated and the Thread object restarts the thread when the time interval has expired.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.