pthread_getschedparam(3THR) は、既存のスレッドの優先順位を取得します。
プロトタイプ: int pthread_getschedparam(pthread_t tid, int policy, struct schedparam *param); |
#include <pthread.h> pthread_t tid; sched_param param; int priority; int policy; int ret; /* 対象のスレッドのスケジューリングパラメータ */ ret = pthread_getschedparam (tid, &policy, ¶m); /* sched_priority は、スレッドの方針を含む */ priority = param.sched_priority; |
正常終了時は 0 です。それ以外の戻り値は、エラーが発生したことを示します。以下の条件が検出されると、この関数は失敗し、次の値を返します。