开发者

Check if a thread exists by it handle

开发者 https://www.devze.com 2022-12-28 15:03 出处:网络
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.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消