Export (0) Print
Expand All

ResumeThread

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This function decrements a thread's suspend count. When the suspend count is decremented to zero, the execution of the thread is resumed.


DWORD ResumeThread(
  HANDLE hThread
);

hThread

[in] Specifies a handle for the thread to be restarted.

The previous suspend count of the thread indicates success. 0xFFFFFFFF indicates failure. To get extended error information, call GetLastError.

This function checks the suspend count of the subject thread.

If the suspend count is zero, the thread is not suspended. Otherwise, the subject thread's suspend count is decremented. If the resulting value is zero, the execution of the subject thread is resumed.

If the return value is zero, the specified thread was not suspended.

If the return value is 1, the specified thread was suspended but was restarted.

If the return value is greater than 1, the specified thread is still suspended.

When reporting debug events, all threads within the reporting process are frozen.

Debuggers are expected to use the SuspendThread and ResumeThread functions to limit the set of threads that can execute within a process.

By suspending all threads in a process except for the one reporting a debug event, it is possible to "single step" a single thread. Other threads are not released by a continue operation if they are suspended.

Headerwinbase.h
Librarycoredll.lib
Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

ADD
Show:
© 2014 Microsoft