Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4588eb6c
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4588eb6c
编写于
5月 22, 2012
作者:
R
rbackman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7161732: Improve handling of thread_id in OSThread
Reviewed-by: dholmes, kamg
上级
35ff8cd8
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
42 addition
and
97 deletion
+42
-97
src/os/bsd/vm/osThread_bsd.hpp
src/os/bsd/vm/osThread_bsd.hpp
+6
-44
src/os/linux/vm/osThread_linux.hpp
src/os/linux/vm/osThread_linux.hpp
+2
-15
src/os/solaris/vm/osThread_solaris.hpp
src/os/solaris/vm/osThread_solaris.hpp
+2
-4
src/os/windows/vm/osThread_windows.hpp
src/os/windows/vm/osThread_windows.hpp
+3
-7
src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp
src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp
+2
-8
src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp
src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp
+3
-3
src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp
src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp
+3
-3
src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp
src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp
+3
-3
src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp
src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp
+3
-3
src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp
src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp
+2
-2
src/share/vm/runtime/osThread.hpp
src/share/vm/runtime/osThread.hpp
+13
-5
未找到文件。
src/os/bsd/vm/osThread_bsd.hpp
浏览文件 @
4588eb6c
...
...
@@ -42,25 +42,18 @@
#ifdef _ALLBSD_SOURCE
#ifdef __APPLE__
t
hread_t
_thread_id
;
t
ypedef
thread_t
thread_id_t
;
#else
pthread_t
_thread_id
;
typedef
pthread_t
thread_id_t
;
#endif
// _pthread_id is the pthread id, which is used by library calls
// (e.g. pthread_kill).
pthread_t
_pthread_id
;
#else
// _thread_id is kernel thread id (similar to LWP id on Solaris). Each
// thread has a unique thread_id (BsdThreads or NPTL). It can be used
// to access /proc.
pid_t
_thread_id
;
typedef
pid_t
thread_id_t
;
#endif
// _pthread_id is the pthread id, which is used by library calls
// (e.g. pthread_kill).
pthread_t
_pthread_id
;
#endif
sigset_t
_caller_sigmask
;
// Caller's signal mask
...
...
@@ -70,28 +63,11 @@
sigset_t
caller_sigmask
()
const
{
return
_caller_sigmask
;
}
void
set_caller_sigmask
(
sigset_t
sigmask
)
{
_caller_sigmask
=
sigmask
;
}
#ifdef _ALLBSD_SOURCE
#ifdef __APPLE__
static
size_t
thread_id_size
()
{
return
sizeof
(
thread_t
);
}
thread_t
thread_id
()
const
{
return
_thread_id
;
}
#else
static
size_t
thread_id_size
()
{
return
sizeof
(
pthread_t
);
}
pthread_t
thread_id
()
const
{
return
_thread_id
;
}
#endif
#else
static
size_t
thread_id_size
()
{
return
sizeof
(
pid_t
);
}
pid_t
thread_id
()
const
{
return
_thread_id
;
}
#endif
#ifndef PRODUCT
// Used for debugging, return a unique integer for each thread.
intptr_t
thread_identifier
()
const
{
return
(
intptr_t
)
_pthread_id
;
}
#endif
#ifdef ASSERT
// We expect no reposition failures so kill vm if we get one.
//
...
...
@@ -99,21 +75,7 @@
return
false
;
}
#endif // ASSERT
#ifdef _ALLBSD_SOURCE
#ifdef __APPLE__
void
set_thread_id
(
thread_t
id
)
{
_thread_id
=
id
;
}
#else
void
set_thread_id
(
pthread_t
id
)
{
_thread_id
=
id
;
}
#endif
#else
void
set_thread_id
(
pid_t
id
)
{
_thread_id
=
id
;
}
#endif
pthread_t
pthread_id
()
const
{
return
_pthread_id
;
}
...
...
src/os/linux/vm/osThread_linux.hpp
浏览文件 @
4588eb6c
...
...
@@ -24,6 +24,8 @@
#ifndef OS_LINUX_VM_OSTHREAD_LINUX_HPP
#define OS_LINUX_VM_OSTHREAD_LINUX_HPP
public
:
typedef
pid_t
thread_id_t
;
private
:
int
_thread_type
;
...
...
@@ -37,13 +39,6 @@
_thread_type
=
type
;
}
private
:
// _thread_id is kernel thread id (similar to LWP id on Solaris). Each
// thread has a unique thread_id (LinuxThreads or NPTL). It can be used
// to access /proc.
pid_t
_thread_id
;
// _pthread_id is the pthread id, which is used by library calls
// (e.g. pthread_kill).
pthread_t
_pthread_id
;
...
...
@@ -56,11 +51,6 @@
sigset_t
caller_sigmask
()
const
{
return
_caller_sigmask
;
}
void
set_caller_sigmask
(
sigset_t
sigmask
)
{
_caller_sigmask
=
sigmask
;
}
static
size_t
thread_id_size
()
{
return
sizeof
(
pid_t
);
}
pid_t
thread_id
()
const
{
return
_thread_id
;
}
#ifndef PRODUCT
// Used for debugging, return a unique integer for each thread.
int
thread_identifier
()
const
{
return
_thread_id
;
}
...
...
@@ -72,9 +62,6 @@
return
false
;
}
#endif // ASSERT
void
set_thread_id
(
pid_t
id
)
{
_thread_id
=
id
;
}
pthread_t
pthread_id
()
const
{
return
_pthread_id
;
}
...
...
src/os/solaris/vm/osThread_solaris.hpp
浏览文件 @
4588eb6c
...
...
@@ -26,9 +26,10 @@
#define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
// This is embedded via include into the class OSThread
public
:
typedef
thread_t
thread_id_t
;
private
:
thread_t
_thread_id
;
// Solaris thread id
uint
_lwp_id
;
// lwp ID, only used with bound threads
int
_native_priority
;
// Saved native priority when starting
// a bound thread
...
...
@@ -36,8 +37,6 @@
bool
_vm_created_thread
;
// true if the VM created this thread,
// false if primary thread or attached thread
public
:
static
size_t
thread_id_size
()
{
return
sizeof
(
thread_t
);
}
thread_t
thread_id
()
const
{
return
_thread_id
;
}
uint
lwp_id
()
const
{
return
_lwp_id
;
}
int
native_priority
()
const
{
return
_native_priority
;
}
...
...
@@ -63,7 +62,6 @@
return
true
;
}
#endif
void
set_thread_id
(
thread_t
id
)
{
_thread_id
=
id
;
}
void
set_lwp_id
(
uint
id
)
{
_lwp_id
=
id
;
}
void
set_native_priority
(
int
prio
)
{
_native_priority
=
prio
;
}
...
...
src/os/windows/vm/osThread_windows.hpp
浏览文件 @
4588eb6c
...
...
@@ -25,12 +25,13 @@
#ifndef OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
#define OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
typedef
void
*
HANDLE
;
typedef
void
*
HANDLE
;
public
:
typedef
unsigned
long
thread_id_t
;
private
:
// Win32-specific thread information
HANDLE
_thread_handle
;
// Win32 thread handle
unsigned
long
_thread_id
;
// Win32 thread id
HANDLE
_interrupt_event
;
// Event signalled on thread interrupt
ThreadState
_last_state
;
...
...
@@ -42,9 +43,6 @@ typedef void* HANDLE;
HANDLE
interrupt_event
()
const
{
return
_interrupt_event
;
}
void
set_interrupt_event
(
HANDLE
interrupt_event
)
{
_interrupt_event
=
interrupt_event
;
}
static
size_t
thread_id_size
()
{
return
sizeof
(
unsigned
long
);
}
unsigned
long
thread_id
()
const
{
return
_thread_id
;
}
#ifndef PRODUCT
// Used for debugging, return a unique integer for each thread.
int
thread_identifier
()
const
{
return
_thread_id
;
}
...
...
@@ -56,8 +54,6 @@ typedef void* HANDLE;
return
false
;
}
#endif // ASSERT
void
set_thread_id
(
unsigned
long
thread_id
)
{
_thread_id
=
thread_id
;
}
bool
is_try_mutex_enter
()
{
return
false
;
}
// This is a temporary fix for the thread states during
...
...
src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp
浏览文件 @
4588eb6c
...
...
@@ -29,18 +29,12 @@
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
#ifdef __APPLE__
#define OS_THREAD_ID_TYPE thread_t
#else
#define OS_THREAD_ID_TYPE pthread_t
#endif
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
\
/******************************/
\
/* Threads (NOTE: incomplete) */
\
/******************************/
\
nonstatic_field(OSThread, _thread_id, OS
_THREAD_ID_TYPE)
\
nonstatic_field(OSThread, _thread_id, OS
Thread::thread_id_t)
\
nonstatic_field(OSThread, _pthread_id, pthread_t) \
/* This must be the last entry, and must be present */
\
last_entry()
...
...
@@ -52,7 +46,7 @@
/* Posix Thread IDs */
\
/**********************/
\
\
declare_unsigned_integer_type(
thread_t)
\
declare_unsigned_integer_type(
OSThread::thread_id_t)
\
declare_unsigned_integer_type(pthread_t) \
\
/* This must be the last entry, and must be present */
\
...
...
src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp
浏览文件 @
4588eb6c
/*
* Copyright (c) 2000, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -36,7 +36,7 @@
/******************************/
\
\
nonstatic_field(JavaThread, _base_of_stack_pointer, intptr_t*) \
nonstatic_field(OSThread, _thread_id,
pid_t)
\
nonstatic_field(OSThread, _thread_id,
OSThread::thread_id_t)
\
nonstatic_field(OSThread, _pthread_id, pthread_t) \
/* This must be the last entry, and must be present */
\
last_entry()
...
...
@@ -48,7 +48,7 @@
/* POSIX Thread IDs */
\
/**********************/
\
\
declare_integer_type(
pid_t)
\
declare_integer_type(
OSThread::thread_id_t)
\
declare_unsigned_integer_type(pthread_t) \
\
/* This must be the last entry, and must be present */
\
...
...
src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp
浏览文件 @
4588eb6c
/*
* Copyright (c) 2000, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -34,7 +34,7 @@
/******************************/
\
/* Threads (NOTE: incomplete) */
\
/******************************/
\
nonstatic_field(OSThread, _thread_id,
pid_t)
\
nonstatic_field(OSThread, _thread_id,
OSThread::thread_id_t)
\
nonstatic_field(OSThread, _pthread_id, pthread_t) \
/* This must be the last entry, and must be present */
\
last_entry()
...
...
@@ -46,7 +46,7 @@
/* Posix Thread IDs */
\
/**********************/
\
\
declare_integer_type(
pid_t)
\
declare_integer_type(
OSThread::thread_id_t)
\
declare_unsigned_integer_type(pthread_t) \
\
/* This must be the last entry, and must be present */
\
...
...
src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp
浏览文件 @
4588eb6c
/*
* Copyright (c) 2000, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -36,7 +36,7 @@
/******************************/
\
\
nonstatic_field(JavaThread, _base_of_stack_pointer, intptr_t*) \
nonstatic_field(OSThread, _thread_id,
thread_t)
\
nonstatic_field(OSThread, _thread_id,
OSThread::thread_id_t)
\
/* This must be the last entry, and must be present */
\
last_entry()
...
...
@@ -47,7 +47,7 @@
/* Solaris Thread IDs */
\
/**********************/
\
\
declare_unsigned_integer_type(
thread_t)
\
declare_unsigned_integer_type(
OSThread::thread_id_t)
\
\
/* This must be the last entry, and must be present */
\
last_entry()
...
...
src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp
浏览文件 @
4588eb6c
/*
* Copyright (c) 2000, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -35,7 +35,7 @@
/* Threads (NOTE: incomplete) */
\
/******************************/
\
\
nonstatic_field(OSThread, _thread_id,
thread_t)
\
nonstatic_field(OSThread, _thread_id,
OSThread::thread_id_t)
\
\
/* This must be the last entry, and must be present */
\
last_entry()
...
...
@@ -46,7 +46,7 @@
/* Solaris Thread IDs */
\
/**********************/
\
\
declare_unsigned_integer_type(
thread_t)
\
declare_unsigned_integer_type(
OSThread::thread_id_t)
\
\
/* This must be the last entry, and must be present */
\
last_entry()
...
...
src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp
浏览文件 @
4588eb6c
/*
* Copyright (c) 2000, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -35,7 +35,7 @@
/* Threads (NOTE: incomplete) */
\
/******************************/
\
\
nonstatic_field(OSThread, _thread_id,
unsigned long)
\
nonstatic_field(OSThread, _thread_id,
OSThread::thread_id_t)
\
unchecked_nonstatic_field(OSThread, _thread_handle, sizeof(HANDLE))
/* NOTE: no type */
\
\
/* This must be the last entry, and must be present */
\
...
...
src/share/vm/runtime/osThread.hpp
浏览文件 @
4588eb6c
...
...
@@ -61,7 +61,6 @@ enum ThreadState {
class
OSThread
:
public
CHeapObj
{
friend
class
VMStructs
;
private:
//void* _start_proc; // Thread start routine
OSThreadStartFunc
_start_proc
;
// Thread start routine
void
*
_start_parm
;
// Thread start routine parameter
volatile
ThreadState
_state
;
// Thread state *hint*
...
...
@@ -77,10 +76,7 @@ class OSThread: public CHeapObj {
void
set_state
(
ThreadState
state
)
{
_state
=
state
;
}
ThreadState
get_state
()
{
return
_state
;
}
// Constructor
OSThread
(
OSThreadStartFunc
start_proc
,
void
*
start_parm
);
// Destructor
~
OSThread
();
// Accessors
...
...
@@ -98,7 +94,6 @@ class OSThread: public CHeapObj {
// For java intrinsics:
static
ByteSize
interrupted_offset
()
{
return
byte_offset_of
(
OSThread
,
_interrupted
);
}
static
ByteSize
thread_id_offset
()
{
return
byte_offset_of
(
OSThread
,
_thread_id
);
}
// Platform dependent stuff
#ifdef TARGET_OS_FAMILY_linux
...
...
@@ -114,6 +109,19 @@ class OSThread: public CHeapObj {
# include "osThread_bsd.hpp"
#endif
public:
static
ByteSize
thread_id_offset
()
{
return
byte_offset_of
(
OSThread
,
_thread_id
);
}
static
size_t
thread_id_size
()
{
return
sizeof
(
thread_id_t
);
}
thread_id_t
thread_id
()
const
{
return
_thread_id
;
}
void
set_thread_id
(
thread_id_t
id
)
{
_thread_id
=
id
;
}
private:
// _thread_id is kernel thread id (similar to LWP id on Solaris). Each
// thread has a unique thread_id (BsdThreads or NPTL). It can be used
// to access /proc.
thread_id_t
_thread_id
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录