Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
fab41a85
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fab41a85
编写于
5月 17, 2019
作者:
D
dholmes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8151322: Implement os::set_native_thread_name() on Solaris
Reviewed-by: sla, kbarrett, gziemski
上级
3087773f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
4 deletion
+22
-4
src/os/solaris/vm/os_solaris.cpp
src/os/solaris/vm/os_solaris.cpp
+17
-2
src/os/solaris/vm/os_solaris.hpp
src/os/solaris/vm/os_solaris.hpp
+4
-1
src/share/vm/utilities/globalDefinitions.hpp
src/share/vm/utilities/globalDefinitions.hpp
+1
-1
未找到文件。
src/os/solaris/vm/os_solaris.cpp
浏览文件 @
fab41a85
...
@@ -160,6 +160,7 @@ address os::Solaris::handler_end; // end pc of thr_sighndlrinfo
...
@@ -160,6 +160,7 @@ address os::Solaris::handler_end; // end pc of thr_sighndlrinfo
address
os
::
Solaris
::
_main_stack_base
=
NULL
;
// 4352906 workaround
address
os
::
Solaris
::
_main_stack_base
=
NULL
;
// 4352906 workaround
os
::
Solaris
::
pthread_setname_np_func_t
os
::
Solaris
::
_pthread_setname_np
=
NULL
;
// "default" initializers for missing libc APIs
// "default" initializers for missing libc APIs
extern
"C"
{
extern
"C"
{
...
@@ -519,8 +520,15 @@ static bool assign_distribution(processorid_t* id_array,
...
@@ -519,8 +520,15 @@ static bool assign_distribution(processorid_t* id_array,
}
}
void
os
::
set_native_thread_name
(
const
char
*
name
)
{
void
os
::
set_native_thread_name
(
const
char
*
name
)
{
// Not yet implemented.
if
(
Solaris
::
_pthread_setname_np
!=
NULL
)
{
return
;
// Only the first 31 bytes of 'name' are processed by pthread_setname_np
// but we explicitly copy into a size-limited buffer to avoid any
// possible overflow.
char
buf
[
32
];
snprintf
(
buf
,
sizeof
(
buf
),
"%s"
,
name
);
buf
[
sizeof
(
buf
)
-
1
]
=
'\0'
;
Solaris
::
_pthread_setname_np
(
pthread_self
(),
buf
);
}
}
}
bool
os
::
distribute_processes
(
uint
length
,
uint
*
distribution
)
{
bool
os
::
distribute_processes
(
uint
length
,
uint
*
distribution
)
{
...
@@ -4921,6 +4929,13 @@ void os::init(void) {
...
@@ -4921,6 +4929,13 @@ void os::init(void) {
// the minimum of what the OS supports (thr_min_stack()), and
// the minimum of what the OS supports (thr_min_stack()), and
// enough to allow the thread to get to user bytecode execution.
// enough to allow the thread to get to user bytecode execution.
Solaris
::
min_stack_allowed
=
MAX2
(
thr_min_stack
(),
Solaris
::
min_stack_allowed
);
Solaris
::
min_stack_allowed
=
MAX2
(
thr_min_stack
(),
Solaris
::
min_stack_allowed
);
// retrieve entry point for pthread_setname_np
void
*
handle
=
dlopen
(
"libc.so.1"
,
RTLD_LAZY
);
if
(
handle
!=
NULL
)
{
Solaris
::
_pthread_setname_np
=
(
Solaris
::
pthread_setname_np_func_t
)
dlsym
(
handle
,
"pthread_setname_np"
);
}
// If the pagesize of the VM is greater than 8K determine the appropriate
// If the pagesize of the VM is greater than 8K determine the appropriate
// number of initial guard pages. The user can change this with the
// number of initial guard pages. The user can change this with the
// command line arguments, if needed.
// command line arguments, if needed.
...
...
src/os/solaris/vm/os_solaris.hpp
浏览文件 @
fab41a85
/*
/*
* Copyright (c) 1997, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -132,6 +132,9 @@ class Solaris {
...
@@ -132,6 +132,9 @@ class Solaris {
static
void
set_SIGinterrupt
(
int
newsig
)
{
_SIGinterrupt
=
newsig
;
}
static
void
set_SIGinterrupt
(
int
newsig
)
{
_SIGinterrupt
=
newsig
;
}
static
void
set_SIGasync
(
int
newsig
)
{
_SIGasync
=
newsig
;
}
static
void
set_SIGasync
(
int
newsig
)
{
_SIGasync
=
newsig
;
}
typedef
int
(
*
pthread_setname_np_func_t
)(
pthread_t
,
const
char
*
);
static
pthread_setname_np_func_t
_pthread_setname_np
;
public:
public:
// Large Page Support--ISM.
// Large Page Support--ISM.
static
bool
largepage_range
(
char
*
addr
,
size_t
size
);
static
bool
largepage_range
(
char
*
addr
,
size_t
size
);
...
...
src/share/vm/utilities/globalDefinitions.hpp
浏览文件 @
fab41a85
...
@@ -332,7 +332,7 @@ inline size_t pointer_delta(const MetaWord* left, const MetaWord* right) {
...
@@ -332,7 +332,7 @@ inline size_t pointer_delta(const MetaWord* left, const MetaWord* right) {
// so far from the middle of the road that it is likely to be problematic in
// so far from the middle of the road that it is likely to be problematic in
// many C++ compilers.
// many C++ compilers.
//
//
#define CAST_TO_FN_PTR(func_type, value) (
(func_type)(castable_address(value)
))
#define CAST_TO_FN_PTR(func_type, value) (
reinterpret_cast<func_type>(value
))
#define CAST_FROM_FN_PTR(new_type, func_ptr) ((new_type)((address_word)(func_ptr)))
#define CAST_FROM_FN_PTR(new_type, func_ptr) ((new_type)((address_word)(func_ptr)))
// Unsigned byte types for os and stream.hpp
// Unsigned byte types for os and stream.hpp
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录