<div class="meta" robots="noindex">

</div>

Method

# Thread.Kill

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Thread.Stop<thread.stop>` as a replacement.

</div>

## 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.

<div class="note">

<div class="title">

Note

</div>

A thread should not <span class="title-ref">Kill</span> itself. Instead, just return from the Run event handler to allow the thread to terminate.

</div>

## Sample code

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

``` xojo
LongProcessThread1.Kill
```

## Compatibility

All project types on all supported operating systems.
