Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
b0f3471d
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看板
提交
b0f3471d
编写于
2月 28, 2013
作者:
D
dcubed
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
5b7a3b0a
8ca53883
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
47 addition
and
8 deletion
+47
-8
src/share/vm/prims/jvmtiEnvBase.cpp
src/share/vm/prims/jvmtiEnvBase.cpp
+8
-2
src/share/vm/runtime/synchronizer.cpp
src/share/vm/runtime/synchronizer.cpp
+1
-0
src/share/vm/runtime/thread.cpp
src/share/vm/runtime/thread.cpp
+4
-2
src/share/vm/services/threadService.cpp
src/share/vm/services/threadService.cpp
+34
-4
未找到文件。
src/share/vm/prims/jvmtiEnvBase.cpp
浏览文件 @
b0f3471d
...
@@ -997,13 +997,19 @@ JvmtiEnvBase::get_object_monitor_usage(JavaThread* calling_thread, jobject objec
...
@@ -997,13 +997,19 @@ JvmtiEnvBase::get_object_monitor_usage(JavaThread* calling_thread, jobject objec
// move our object at this point. However, our owner value is safe
// move our object at this point. However, our owner value is safe
// since it is either the Lock word on a stack or a JavaThread *.
// since it is either the Lock word on a stack or a JavaThread *.
owning_thread
=
Threads
::
owning_thread_from_monitor_owner
(
owner
,
!
at_safepoint
);
owning_thread
=
Threads
::
owning_thread_from_monitor_owner
(
owner
,
!
at_safepoint
);
assert
(
owning_thread
!=
NULL
,
"sanity check"
);
// Cannot assume (owning_thread != NULL) here because this function
if
(
owning_thread
!=
NULL
)
{
// robustness
// may not have been called at a safepoint and the owning_thread
// might not be suspended.
if
(
owning_thread
!=
NULL
)
{
// The monitor's owner either has to be the current thread, at safepoint
// The monitor's owner either has to be the current thread, at safepoint
// or it has to be suspended. Any of these conditions will prevent both
// or it has to be suspended. Any of these conditions will prevent both
// contending and waiting threads from modifying the state of
// contending and waiting threads from modifying the state of
// the monitor.
// the monitor.
if
(
!
at_safepoint
&&
!
JvmtiEnv
::
is_thread_fully_suspended
(
owning_thread
,
true
,
&
debug_bits
))
{
if
(
!
at_safepoint
&&
!
JvmtiEnv
::
is_thread_fully_suspended
(
owning_thread
,
true
,
&
debug_bits
))
{
// Don't worry! This return of JVMTI_ERROR_THREAD_NOT_SUSPENDED
// will not make it back to the JVM/TI agent. The error code will
// get intercepted in JvmtiEnv::GetObjectMonitorUsage() which
// will retry the call via a VM_GetObjectMonitorUsage VM op.
return
JVMTI_ERROR_THREAD_NOT_SUSPENDED
;
return
JVMTI_ERROR_THREAD_NOT_SUSPENDED
;
}
}
HandleMark
hm
;
HandleMark
hm
;
...
...
src/share/vm/runtime/synchronizer.cpp
浏览文件 @
b0f3471d
...
@@ -813,6 +813,7 @@ JavaThread* ObjectSynchronizer::get_lock_owner(Handle h_obj, bool doLock) {
...
@@ -813,6 +813,7 @@ JavaThread* ObjectSynchronizer::get_lock_owner(Handle h_obj, bool doLock) {
}
}
if
(
owner
!=
NULL
)
{
if
(
owner
!=
NULL
)
{
// owning_thread_from_monitor_owner() may also return NULL here
return
Threads
::
owning_thread_from_monitor_owner
(
owner
,
doLock
);
return
Threads
::
owning_thread_from_monitor_owner
(
owner
,
doLock
);
}
}
...
...
src/share/vm/runtime/thread.cpp
浏览文件 @
b0f3471d
...
@@ -4285,7 +4285,9 @@ JavaThread *Threads::owning_thread_from_monitor_owner(address owner, bool doLock
...
@@ -4285,7 +4285,9 @@ JavaThread *Threads::owning_thread_from_monitor_owner(address owner, bool doLock
if
(
owner
==
(
address
)
p
)
return
p
;
if
(
owner
==
(
address
)
p
)
return
p
;
}
}
}
}
assert
(
UseHeavyMonitors
==
false
,
"Did not find owning Java thread with UseHeavyMonitors enabled"
);
// Cannot assert on lack of success here since this function may be
// used by code that is trying to report useful problem information
// like deadlock detection.
if
(
UseHeavyMonitors
)
return
NULL
;
if
(
UseHeavyMonitors
)
return
NULL
;
//
//
...
@@ -4303,7 +4305,7 @@ JavaThread *Threads::owning_thread_from_monitor_owner(address owner, bool doLock
...
@@ -4303,7 +4305,7 @@ JavaThread *Threads::owning_thread_from_monitor_owner(address owner, bool doLock
}
}
}
}
}
}
assert
(
the_owner
!=
NULL
,
"Did not find owning Java thread for lock word address"
);
// cannot assert on lack of success here; see above comment
return
the_owner
;
return
the_owner
;
}
}
...
...
src/share/vm/services/threadService.cpp
浏览文件 @
b0f3471d
/*
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
3
, 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
...
@@ -327,8 +327,28 @@ DeadlockCycle* ThreadService::find_deadlocks_at_safepoint(bool concurrent_locks)
...
@@ -327,8 +327,28 @@ DeadlockCycle* ThreadService::find_deadlocks_at_safepoint(bool concurrent_locks)
while
(
waitingToLockMonitor
!=
NULL
||
waitingToLockBlocker
!=
NULL
)
{
while
(
waitingToLockMonitor
!=
NULL
||
waitingToLockBlocker
!=
NULL
)
{
cycle
->
add_thread
(
currentThread
);
cycle
->
add_thread
(
currentThread
);
if
(
waitingToLockMonitor
!=
NULL
)
{
if
(
waitingToLockMonitor
!=
NULL
)
{
currentThread
=
Threads
::
owning_thread_from_monitor_owner
((
address
)
waitingToLockMonitor
->
owner
(),
currentThread
=
Threads
::
owning_thread_from_monitor_owner
(
false
/* no locking needed */
);
(
address
)
waitingToLockMonitor
->
owner
(),
false
/* no locking needed */
);
if
(
currentThread
==
NULL
)
{
// This function is called at a safepoint so the JavaThread
// that owns waitingToLockMonitor should be findable, but
// if it is not findable, then the previous currentThread is
// blocked permanently. We record this as a deadlock.
num_deadlocks
++
;
cycle
->
set_deadlock
(
true
);
// add this cycle to the deadlocks list
if
(
deadlocks
==
NULL
)
{
deadlocks
=
cycle
;
}
else
{
last
->
set_next
(
cycle
);
}
last
=
cycle
;
cycle
=
new
DeadlockCycle
();
break
;
}
}
else
{
}
else
{
if
(
concurrent_locks
)
{
if
(
concurrent_locks
)
{
if
(
waitingToLockBlocker
->
is_a
(
SystemDictionary
::
abstract_ownable_synchronizer_klass
()))
{
if
(
waitingToLockBlocker
->
is_a
(
SystemDictionary
::
abstract_ownable_synchronizer_klass
()))
{
...
@@ -841,7 +861,17 @@ void DeadlockCycle::print_on(outputStream* st) const {
...
@@ -841,7 +861,17 @@ void DeadlockCycle::print_on(outputStream* st) const {
owner_desc
=
" (JVMTI raw monitor),
\n
which is held by"
;
owner_desc
=
" (JVMTI raw monitor),
\n
which is held by"
;
}
}
currentThread
=
Threads
::
owning_thread_from_monitor_owner
(
currentThread
=
Threads
::
owning_thread_from_monitor_owner
(
(
address
)
waitingToLockMonitor
->
owner
(),
false
/* no locking needed */
);
(
address
)
waitingToLockMonitor
->
owner
(),
false
/* no locking needed */
);
if
(
currentThread
==
NULL
)
{
// The deadlock was detected at a safepoint so the JavaThread
// that owns waitingToLockMonitor should be findable, but
// if it is not findable, then the previous currentThread is
// blocked permanently.
st
->
print
(
"%s UNKNOWN_owner_addr="
PTR_FORMAT
,
owner_desc
,
(
address
)
waitingToLockMonitor
->
owner
());
continue
;
}
}
else
{
}
else
{
st
->
print
(
" waiting for ownable synchronizer "
INTPTR_FORMAT
", (a %s)"
,
st
->
print
(
" waiting for ownable synchronizer "
INTPTR_FORMAT
", (a %s)"
,
(
address
)
waitingToLockBlocker
,
(
address
)
waitingToLockBlocker
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录