INtime SDK Help
ExitThread, RtExitThread (iwin32)
INtime SDK v6 > About INtime > Alternate APIs > iwin32 API > iwin32 API > ExitThread, RtExitThread (iwin32)

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
);

Parameters

dwExitCode
Specifies the exit code for the calling thread.

To retrieve a thread's exit code, use GetExitCodeThread.

Remarks

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.

Return Values

None.

Requirements

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

See Also

RtCreateProcess, CreateThread, GetExitCodeThread, iwin32 API, iwin32 Overview