LoginSignup
3
3

More than 5 years have passed since last update.

自分のスレッドの優先度を取得する方法

Last updated at Posted at 2014-04-15
DWORD id = GetCurrentThreadId();
HANDLE h = OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,false,id);
int priority = GetThreadPriority(h);
CloseHandle(h);

 

得られるプライオリティ値

priority 対応マクロ(WinBase.h) メモ
-2 THREAD_PRIORITY_LOWEST
-1 THREAD_PRIORITY_BELOW_NORMAL
0 THREAD_PRIORITY_NORMAL
1 THREAD_PRIORITY_ABOVE_NORMAL
2 THREAD_PRIORITY_HIGHEST
0x7fffffff THREAD_PRIORITY_ERROR_RETURN 取得できなかった時
15 THREAD_PRIORITY_TIME_CRITICAL 11以上の優先度ではOSの動作に影響する
-15 THREAD_PRIORITY_IDLE
3
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3