提交 6e2afa57 编写于 作者: M mneugschwand

8235908: omit ThreadPriorityPolicy warning when value is set from image

Reviewed-by: dholmes, clanger, kvn
上级 fabeb31b
......@@ -2484,7 +2484,7 @@ int os::java_to_os_priority[CriticalPriority + 1] = {
static int prio_init() {
if (ThreadPriorityPolicy == 1) {
if (geteuid() != 0) {
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy)) {
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy) && !FLAG_IS_JIMAGE_RESOURCE(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.");
......
......@@ -4334,7 +4334,7 @@ int os::java_to_os_priority[CriticalPriority + 1] = {
static int prio_init() {
if (ThreadPriorityPolicy == 1) {
if (geteuid() != 0) {
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy)) {
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy) && !FLAG_IS_JIMAGE_RESOURCE(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.");
......
......@@ -294,6 +294,10 @@ bool JVMFlag::is_command_line() {
return (_flags & ORIG_COMMAND_LINE) != 0;
}
bool JVMFlag::is_jimage_resource() {
return (get_origin() == JIMAGE_RESOURCE);
}
void JVMFlag::set_command_line() {
_flags = Flags(_flags | ORIG_COMMAND_LINE);
}
......@@ -989,6 +993,12 @@ bool JVMFlag::wasSetOnCmdline(const char* name, bool* value) {
return true;
}
bool JVMFlagEx::is_jimage_resource(JVMFlags flag) {
assert((size_t)flag < JVMFlag::numFlags, "bad command line flag index");
JVMFlag* f = &JVMFlag::flags[flag];
return f->is_jimage_resource();
}
void JVMFlagEx::setOnCmdLine(JVMFlagsWithType flag) {
JVMFlag* faddr = address_of_flag(flag);
assert(faddr != NULL, "Unknown flag");
......
......@@ -175,6 +175,7 @@ struct JVMFlag {
bool is_default();
bool is_ergonomic();
bool is_jimage_resource();
bool is_command_line();
void set_command_line();
......
......@@ -299,6 +299,7 @@ typedef enum {
#define FLAG_IS_DEFAULT(name) (JVMFlagEx::is_default(FLAG_MEMBER(name)))
#define FLAG_IS_ERGO(name) (JVMFlagEx::is_ergo(FLAG_MEMBER(name)))
#define FLAG_IS_CMDLINE(name) (JVMFlagEx::is_cmdline(FLAG_MEMBER(name)))
#define FLAG_IS_JIMAGE_RESOURCE(name) (JVMFlagEx::is_jimage_resource(FLAG_MEMBER(name)))
#define FLAG_SET_DEFAULT(name, value) ((name) = (value))
......@@ -330,6 +331,7 @@ class JVMFlagEx : JVMFlag {
static bool is_default(JVMFlags flag);
static bool is_ergo(JVMFlags flag);
static bool is_cmdline(JVMFlags flag);
static bool is_jimage_resource(JVMFlags flag);
static void setOnCmdLine(JVMFlagsWithType flag);
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册