diff options
author | rbackman <none@none> | 2012-05-22 10:11:53 +0200 |
---|---|---|
committer | rbackman <none@none> | 2012-05-22 10:11:53 +0200 |
commit | 9c4321ddce7080afd4d031c04dbeba761dbed295 (patch) | |
tree | 21dd71faf934de0fa5adabfd1caed1a7fe9bf80f /src/share/vm | |
parent | cf8088aac7e68db13a2ffe3b24353fb9bb260d7c (diff) |
7161732: Improve handling of thread_id in OSThread
Reviewed-by: dholmes, kamg
Diffstat (limited to 'src/share/vm')
-rw-r--r-- | src/share/vm/runtime/osThread.hpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/share/vm/runtime/osThread.hpp b/src/share/vm/runtime/osThread.hpp index bb3fd7963..c0f2b1932 100644 --- a/src/share/vm/runtime/osThread.hpp +++ b/src/share/vm/runtime/osThread.hpp @@ -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; }; |