Terminates the specified thread.
BOOLEAN TerminateThread( HANDLE hThread, DWORD dwExitCode BOOLEAN RtTerminateThread( HANDLE hThread, DWORD dwExitCode );
hThread
dwExitCode
To retrieve a thread's exit value, use GetExitCodeThread.
If the target thread is the last thread of a process when this function is called, the thread's process also terminates.
The thread object's state becomes signaled, releasing any other threads waiting for the thread to terminate. The thread's termination status changes from STILL_ACTIVE to the value of the dwExitCode parameter.
If the thread owned one or more mutexes, all threads waiting for such mutexes wake with a WAIT_ABANDONED exception.
RSLs attached to the thread are notified that the thread is terminating.
Terminating a thread does not necessarily remove the thread object from the system. A thread object is deleted when the last thread handle closes.
0
(zero)
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/iwin32.h intime/rt/include/winbase.h |
iwin32.h windows.h |
iwin32.lib |
Note
RtCreateProcess, CreateThread, GetExitCodeThread, iwin32 API, iwin32 Overview