6.8. Other Thread Functions

There are several thread functions not demonstrated in the above examples that are useful in certain situations. Each of these functions is briefly described below:

The SuspendThread and ResumeThread functions let you temporarily stop and restart the execution of a thread. If you start a thread in a suspended state by setting the creation flags in CreateThread to CREATE_SUSPENDED, then ResumeThread is the only way to get the thread running at a later time. There are also cases where the use of suspension and resumption is the easiest way to control a thread. See, for example, Chapter 12, where the Pause and Continue features of a service are implemented this way.

Each thread keeps track of a suspend count. Calling ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.