SuspendThread

SuspendThread suspends the specified thread.

Syntax

Copy
DWORD SuspendThread(
    [in]    HANDLE hThread
);

Parameters

[in] hThread

The thread to suspend.

Return Value

If the function succeeds, it returns the thread's previous suspend count. If the function fails, it returns 0XFFFFFFFF. Call GetLastError to get extended error information.

Remarks

If the function succeeds, the specified thread's execution is suspended, and the thread's suspend count is raised by one.

Suspending a thread causes the thread to stop executing.

Each thread has a suspend count (with a maximum value of MAXIMUM_SUSPEND_COUNT). If the suspend count is greater than zero, the thread is suspended; otherwise, the thread is not suspended and is eligible for execution. Calling SuspendThread causes the target thread's suspend count to be raised by one. Attempting to increment past the maximum suspend count causes an error without incrementing the count.

ResumeThread decrements the suspend count of a suspended thread.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

windows.h

wRTOS_rtss.lib

See Also: