Check if a thread exists by it handle
When I create a thread I s开发者_如何学Cave it handle in a list. After a time I want to check which of them still exists. I'm not looking for other kind of implementation, I want to know if is there some how to get a thread by it handle ?
I found the answer tks srs.
GetExitCodeThread
For more information: http://msdn.microsoft.com/en-us/library/ms683190(VS.85).aspx
If you're just interested in which ones are still running, this should work:
if WaitForSingleObject(ThreadHandle, 0) = WAIT_OBJECT_0 then
// Thread is still running
精彩评论