xHarbour Reference Documentation > Function Reference |
Kills a running thread.
KillThread( <pThreadHandle> ) --> NIL
The return value is always NIL.
Function KillThread() is provided for "emergency recovery", such as dead locks between threads. The function sends a thread termination request to the operating system for the specified thread and returns immediately. It does not guarantee that the thread has actually terminated when the function returns. Use JoinThread() to make sure the thread has terminated.
Important: if a call to KillThread() becomes necessary, the program logic of the multi-threading application should be carefully revised. It is an indication for an error in the usage of multiple threads. To stop a thread from outside, use StopThread(). StopThread() works synchronously while KillThread() works asynchronously.
See also: | HB_MutexCreate(), JoinThread(), KillAllThreads(), StartThread(), StopThread(), ThreadSleep() |
Category: | Multi-threading functions , xHarbour extensions |
Source: | vm\thread.c |
LIB: | xhbmt.lib |
DLL: | xhbmtdll.dll |
http://www.xHarbour.com