Canceling a thread

You can cancel a thread by using the CANCEL THREAD statement.

Read syntax diagramSkip visual syntax diagramCANCEL THREAD ( task-reference)
THREAD task-reference
The THREAD option specifies the task-reference task variable of the thread, upon which the process is canceling. The task variable is generated during the ATTACH of the thread.
The TI1 thread is canceled in the following example:
 CANCEL THREAD (TI1);