Method

Thread.Kill


Warning

This item was deprecated in version 2019r2. Please use Thread.Stop as a replacement.

Description

Kills the specified thread.

Notes

Internally, this method will cause your thread's stack to unwind, destructors for local objects to be called, and so forth. It's a graceful exit which can cause code to execute. It may also cause context switches.

Note

A thread should not Kill itself. Instead, just return from the Run event handler to allow the thread to terminate.

Sample code

This example, which is in the Action event of a button, kills the thread.

LongProcessThread1.Kill

Compatibility

All project types on all supported operating systems.