Navigation: Language Reference > 13 - Built-in Functions >====== RESUME (resume thread execution) ====== | |
RESUME(threadno)
RESUME | Resume thread execution. |
threadno | A numeric constant, variable, or expression that can be evaluated as a SIGNED integer. |
The RESUME procedure restores a thread that has been suspended with the SUSPEND statement. If the threadno parameter is a number of a thread that was previously suspended by the call to SUSPEND, its suspending count is decremented. If the suspending count becomes equal to zero(0), execution of the thread continues from the point where it has been suspended. Therefore, the number of calls to RESUME must be equal to the number of calls to SUSPEND for the thread execution to resume.
RESUME can also be used to activate a new thread immediately. Normally, a procedure does not allocate memory for thread variables until the ACCEPT event handler is executed. RESUME can be used to activate a new thread directly upon procedure entry.
Example:
RESUME(ThreadNumVariable) !attempt to resume thread execution
RESUME(START(MyThreadProc)) !start a new thread immediately
See Also: SUSPEND