8232107: support ThreadPriorityPolicy flag on AIX
Reviewed-by: clanger, dholmes
This commit is contained in:
parent
485f2e7f52
commit
2882b4c549
@ -2643,8 +2643,24 @@ int os::java_to_os_priority[CriticalPriority + 1] = {
|
||||
60 // 11 CriticalPriority
|
||||
};
|
||||
|
||||
static int prio_init() {
|
||||
if (ThreadPriorityPolicy == 1) {
|
||||
if (geteuid() != 0) {
|
||||
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy)) {
|
||||
warning("-XX:ThreadPriorityPolicy=1 may require system level permission, " \
|
||||
"e.g., being the root user. If the necessary permission is not " \
|
||||
"possessed, changes to priority will be silently ignored.");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (UseCriticalJavaThreadPriority) {
|
||||
os::java_to_os_priority[MaxPriority] = os::java_to_os_priority[CriticalPriority];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
OSReturn os::set_native_priority(Thread* thread, int newpri) {
|
||||
if (!UseThreadPriorities) return OS_OK;
|
||||
if (!UseThreadPriorities || ThreadPriorityPolicy == 0) return OS_OK;
|
||||
pthread_t thr = thread->osthread()->pthread_id();
|
||||
int policy = SCHED_OTHER;
|
||||
struct sched_param param;
|
||||
@ -2659,7 +2675,7 @@ OSReturn os::set_native_priority(Thread* thread, int newpri) {
|
||||
}
|
||||
|
||||
OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) {
|
||||
if (!UseThreadPriorities) {
|
||||
if (!UseThreadPriorities || ThreadPriorityPolicy == 0) {
|
||||
*priority_ptr = java_to_os_priority[NormPriority];
|
||||
return OS_OK;
|
||||
}
|
||||
@ -3569,6 +3585,9 @@ jint os::init_2(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// initialize thread priority policy
|
||||
prio_init();
|
||||
|
||||
return JNI_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user