Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
85771c5f
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看板
提交
85771c5f
编写于
2月 22, 2011
作者:
N
never
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7021531: lock ordering problems after fix for 6354181
Reviewed-by: kvn, jrose
上级
3757fbff
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
0 deletion
+30
-0
src/share/vm/ci/ciEnv.cpp
src/share/vm/ci/ciEnv.cpp
+1
-0
src/share/vm/utilities/ostream.cpp
src/share/vm/utilities/ostream.cpp
+11
-0
src/share/vm/utilities/ostream.hpp
src/share/vm/utilities/ostream.hpp
+18
-0
未找到文件。
src/share/vm/ci/ciEnv.cpp
浏览文件 @
85771c5f
...
...
@@ -413,6 +413,7 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
}
KlassHandle
found_klass
;
{
ttyUnlocker
ttyul
;
// release tty lock to avoid ordering problems
MutexLocker
ml
(
Compile_lock
);
klassOop
kls
;
if
(
!
require_local
)
{
...
...
src/share/vm/utilities/ostream.cpp
浏览文件 @
85771c5f
...
...
@@ -699,6 +699,17 @@ void ttyLocker::release_tty(intx holder) {
defaultStream
::
instance
->
release
(
holder
);
}
bool
ttyLocker
::
release_tty_if_locked
()
{
intx
thread_id
=
os
::
current_thread_id
();
if
(
defaultStream
::
instance
->
writer
()
==
thread_id
)
{
// release the lock and return true so callers know if was
// previously held.
release_tty
(
thread_id
);
return
true
;
}
return
false
;
}
void
ttyLocker
::
break_tty_lock_for_safepoint
(
intx
holder
)
{
if
(
defaultStream
::
instance
!=
NULL
&&
defaultStream
::
instance
->
writer
()
==
holder
)
{
...
...
src/share/vm/utilities/ostream.hpp
浏览文件 @
85771c5f
...
...
@@ -123,18 +123,36 @@ extern outputStream* gclog_or_tty; // stream for gc log if -Xloggc:<f>, or tty
// advisory locking for the shared tty stream:
class
ttyLocker
:
StackObj
{
friend
class
ttyUnlocker
;
private:
intx
_holder
;
public:
static
intx
hold_tty
();
// returns a "holder" token
static
void
release_tty
(
intx
holder
);
// must witness same token
static
bool
release_tty_if_locked
();
// returns true if lock was released
static
void
break_tty_lock_for_safepoint
(
intx
holder
);
ttyLocker
()
{
_holder
=
hold_tty
();
}
~
ttyLocker
()
{
release_tty
(
_holder
);
}
};
// Release the tty lock if it's held and reacquire it if it was
// locked. Used to avoid lock ordering problems.
class
ttyUnlocker
:
StackObj
{
private:
bool
_was_locked
;
public:
ttyUnlocker
()
{
_was_locked
=
ttyLocker
::
release_tty_if_locked
();
}
~
ttyUnlocker
()
{
if
(
_was_locked
)
{
ttyLocker
::
hold_tty
();
}
}
};
// for writing to strings; buffer will expand automatically
class
stringStream
:
public
outputStream
{
protected:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录