|Skip Navigation Links|
|Exit Print View|
|man pages section 3: Basic Library Functions Oracle Solaris 11 Express 11/10|
- access dynamic thread scheduling
cc –mt [ flag... ] file...[ library... ] #include <thread.h> int thr_setprio(thread_t target_thread, int priority);
int thr_getprio(thread_t target_thread, int *priority);
The thr_setprio() function sets the scheduling priority for the thread specified by target_thread within the current process to the value given by priority.
The thr_getprio() function stores the current priority for the thread specified by target_thread in the location pointed to by priority.
If the thr_setprio() function fails, the scheduling priority of the target thread is not changed.
If successful, the thr_getprio() and thr_setprio() functions return 0. Otherwise, an error number is returned to indicate the error.
The thr_getprio() and thr_setprio() functions will fail if:
The value specified by target_thread does not refer to an existing thread.
The thr_setprio() function will fail if:
The value of priority is invalid for the scheduling policy of the specified thread.
The caller does not have the appropriate permission to set the priority to the value specified.
See attributes(5) for descriptions of the following attributes: