在c ++ / windows中获得线程状态 [英] getting a thread state in c++/windows
问题描述
必须有一个函数获取系统中线程的当前状态,因为
有此应用程序: http://www.softwareverify.com/cpp/thread-status-monitor/index.html
它必须使用某种API函数或某种...
如何在C ++ / Windows中获得线程状态?
谢谢:)
(这是我今天的最后一个问题,我保证:))
您可以使用以下示例来获取正在运行的进程,以及当您拥有进程ID时的线程。
编辑:获取线程的句柄后,你可以调用 GetExitCodeThread
但是它只会告诉你线程是否 STILL_ACTIVE
,直到它结束,当你可以找到退出代码。 >
在搜索您的评论的其他信息时,我也遇到了这个线程,你可能会感兴趣。
There must be a function that gets the current status of a thread in the system because
there is this application: http://www.softwareverify.com/cpp/thread-status-monitor/index.html
It must be using some sort of API function or something...
How can I get a thread state myself in C++/Windows?
thanks :)
(this is my last question for today. I promise :))
You can use the following examples to get the running processes and, when you have a process ID, the threads.
Taking a Snapshot and Viewing Processes
EDIT: After getting the handle to the thread(s) you are interested in you can call GetExitCodeThread
but that will only tell you if the thread is STILL_ACTIVE
until it ends, when you can find the exit code.
While searching for the additional information for your comment I also came across this thread on SO which might be of interest to you.
这篇关于在c ++ / windows中获得线程状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!