The stopthread Statement
The stopthread statement causes the thread specified in the statement to stop running immediately. This statement cannot be used with the standard NXT firmware. It is supported by the enhanced NBC/NXC firmware. The syntax of the stopthread statement is shown below.
stopthread worker // stop the worker thread