Re: How to get a thread's status?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




<yongzhang81@xxxxxxxxx> wrote in message
news:1129740102.731256.95490@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Given a handle of a thread.How can I get the thread's status is pending
> or not ?
> Any help will be appreciated.

If by "status is pending" you mean "still executing", when the thread
exits, its handle will be signaled. You can use WaitForSingleObject with a
timeout of zero to test the thread's handle to see if it's signaled.

--
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
-gchanson@xxxxxxxx

.



Relevant Pages