Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
6cbf10fc
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看板
提交
6cbf10fc
编写于
4月 09, 2014
作者:
K
kevinw
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
e55ff1ed
29a6384f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
2 deletion
+27
-2
src/os/bsd/vm/os_bsd.cpp
src/os/bsd/vm/os_bsd.cpp
+12
-1
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+12
-1
src/share/vm/runtime/vmThread.cpp
src/share/vm/runtime/vmThread.cpp
+3
-0
未找到文件。
src/os/bsd/vm/os_bsd.cpp
浏览文件 @
6cbf10fc
...
@@ -914,9 +914,20 @@ void os::free_thread(OSThread* osthread) {
...
@@ -914,9 +914,20 @@ void os::free_thread(OSThread* osthread) {
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// thread local storage
// thread local storage
// Restore the thread pointer if the destructor is called. This is in case
// someone from JNI code sets up a destructor with pthread_key_create to run
// detachCurrentThread on thread death. Unless we restore the thread pointer we
// will hang or crash. When detachCurrentThread is called the key will be set
// to null and we will not be called again. If detachCurrentThread is never
// called we could loop forever depending on the pthread implementation.
static
void
restore_thread_pointer
(
void
*
p
)
{
Thread
*
thread
=
(
Thread
*
)
p
;
os
::
thread_local_storage_at_put
(
ThreadLocalStorage
::
thread_index
(),
thread
);
}
int
os
::
allocate_thread_local_storage
()
{
int
os
::
allocate_thread_local_storage
()
{
pthread_key_t
key
;
pthread_key_t
key
;
int
rslt
=
pthread_key_create
(
&
key
,
NULL
);
int
rslt
=
pthread_key_create
(
&
key
,
restore_thread_pointer
);
assert
(
rslt
==
0
,
"cannot allocate thread local storage"
);
assert
(
rslt
==
0
,
"cannot allocate thread local storage"
);
return
(
int
)
key
;
return
(
int
)
key
;
}
}
...
...
src/os/linux/vm/os_linux.cpp
浏览文件 @
6cbf10fc
...
@@ -1074,9 +1074,20 @@ void os::free_thread(OSThread* osthread) {
...
@@ -1074,9 +1074,20 @@ void os::free_thread(OSThread* osthread) {
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// thread local storage
// thread local storage
// Restore the thread pointer if the destructor is called. This is in case
// someone from JNI code sets up a destructor with pthread_key_create to run
// detachCurrentThread on thread death. Unless we restore the thread pointer we
// will hang or crash. When detachCurrentThread is called the key will be set
// to null and we will not be called again. If detachCurrentThread is never
// called we could loop forever depending on the pthread implementation.
static
void
restore_thread_pointer
(
void
*
p
)
{
Thread
*
thread
=
(
Thread
*
)
p
;
os
::
thread_local_storage_at_put
(
ThreadLocalStorage
::
thread_index
(),
thread
);
}
int
os
::
allocate_thread_local_storage
()
{
int
os
::
allocate_thread_local_storage
()
{
pthread_key_t
key
;
pthread_key_t
key
;
int
rslt
=
pthread_key_create
(
&
key
,
NULL
);
int
rslt
=
pthread_key_create
(
&
key
,
restore_thread_pointer
);
assert
(
rslt
==
0
,
"cannot allocate thread local storage"
);
assert
(
rslt
==
0
,
"cannot allocate thread local storage"
);
return
(
int
)
key
;
return
(
int
)
key
;
}
}
...
...
src/share/vm/runtime/vmThread.cpp
浏览文件 @
6cbf10fc
...
@@ -316,6 +316,9 @@ void VMThread::run() {
...
@@ -316,6 +316,9 @@ void VMThread::run() {
_terminate_lock
->
notify
();
_terminate_lock
->
notify
();
}
}
// Thread destructor usually does this.
ThreadLocalStorage
::
set_thread
(
NULL
);
// Deletion must be done synchronously by the JNI DestroyJavaVM thread
// Deletion must be done synchronously by the JNI DestroyJavaVM thread
// so that the VMThread deletion completes before the main thread frees
// so that the VMThread deletion completes before the main thread frees
// up the CodeHeap.
// up the CodeHeap.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录