Terminates the current thread and specifies the exit code. Any threads waiting for the thread wake up.
VOID ExitThread( DWORD dwExitCode VOID RtExitThread( DWORD dwExitCode );
dwExitCode
To retrieve a thread's exit code, use GetExitCodeThread.
The preferred method of exiting from a thread is to return from the thread procedure so the system implicitly calls ExitThread, and C++ function cleanup occurs.
When ExitThread is called (explicitly or by returning from a thread procedure), the current thread's stack is deallocated and the thread terminates.
The entry-point function of all attached RSLs is invoked with a value indicating that the thread is detaching from the RSL.
If the thread is the last thread in the process when this function is called, the thread's process also terminates.
The thread object's state becomes signaled, releasing other threads waiting for the thread to terminate.
The thread's termination status changes from STILL_ACTIVE to the dwExitCode parameter's value.
Terminating a thread does not necessarily remove the thread object from the OS. A thread object is deleted when the last handle to the thread closes.
None.
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