ExitThread Procedure

Exits the current thread.

Syntax

ExitThread ()

Comments

ExitThread will end the current thread flushing call stack and deleting local procedure variables and deleting the thread handle. If the current thread is the main application thread, all the other threads will be terminated abnormally before exiting the current thread. Abnormal thread termination, may cause variables or internal state of ATEasy run-time to be in unpredictable manner and it is recommended to exit the process after calling this procedure. Note that returning from the thread procedure (used by CreateThread) also end the current thread.

Example

The following example will exit whichever thread is current:

ExitThread()

See Also

CreateThread, SuspendThread, TerminateThread, WaitForSingleObject, Exit