Check if a Win32 thread is running or in a suspended state

前端 未结 7 1560
清歌不尽
清歌不尽 2020-12-01 11:26

How do I check to see if a Win32 thread is running or in suspended state?

I can\'t find any Win32 API which gives the state of a thread. So how do I get the thread s

7条回答
  •  孤街浪徒
    2020-12-01 11:37

    I think the state here is referred to as

    • If thread is in thread proc , doing some processing Or
    • Waiting for event

    This can be taken care of by using variable which can tell that if a thread is actually running or waiting for event to happen.

    These scenarios appear when considering threadpools, having some n threads and based on each thread running status , tasks can be assigned to idle threads.

提交回复
热议问题