Mercurial > hg > truffle
comparison src/os/solaris/vm/osThread_solaris.hpp @ 6093:960a442eae91
7161732: Improve handling of thread_id in OSThread
Reviewed-by: dholmes, kamg
author | rbackman |
---|---|
date | Tue, 22 May 2012 10:11:53 +0200 |
parents | 0105f367a14c |
children | f2110083203d |
comparison
equal
deleted
inserted
replaced
6082:4b37c0dafe3a | 6093:960a442eae91 |
---|---|
24 | 24 |
25 #ifndef OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP | 25 #ifndef OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP |
26 #define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP | 26 #define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP |
27 | 27 |
28 // This is embedded via include into the class OSThread | 28 // This is embedded via include into the class OSThread |
29 public: | |
30 typedef thread_t thread_id_t; | |
29 | 31 |
30 private: | 32 private: |
31 thread_t _thread_id; // Solaris thread id | |
32 uint _lwp_id; // lwp ID, only used with bound threads | 33 uint _lwp_id; // lwp ID, only used with bound threads |
33 int _native_priority; // Saved native priority when starting | 34 int _native_priority; // Saved native priority when starting |
34 // a bound thread | 35 // a bound thread |
35 sigset_t _caller_sigmask; // Caller's signal mask | 36 sigset_t _caller_sigmask; // Caller's signal mask |
36 bool _vm_created_thread; // true if the VM created this thread, | 37 bool _vm_created_thread; // true if the VM created this thread, |
37 // false if primary thread or attached thread | 38 // false if primary thread or attached thread |
38 public: | 39 public: |
39 static size_t thread_id_size() { return sizeof(thread_t); } | |
40 thread_t thread_id() const { return _thread_id; } | |
41 uint lwp_id() const { return _lwp_id; } | 40 uint lwp_id() const { return _lwp_id; } |
42 int native_priority() const { return _native_priority; } | 41 int native_priority() const { return _native_priority; } |
43 | 42 |
44 // Set and get state of _vm_created_thread flag | 43 // Set and get state of _vm_created_thread flag |
45 void set_vm_created() { _vm_created_thread = true; } | 44 void set_vm_created() { _vm_created_thread = true; } |
61 bool valid_reposition_failure() { | 60 bool valid_reposition_failure() { |
62 // only 1 and 2 can happen and we can handle both of them | 61 // only 1 and 2 can happen and we can handle both of them |
63 return true; | 62 return true; |
64 } | 63 } |
65 #endif | 64 #endif |
66 void set_thread_id(thread_t id) { _thread_id = id; } | |
67 void set_lwp_id(uint id) { _lwp_id = id; } | 65 void set_lwp_id(uint id) { _lwp_id = id; } |
68 void set_native_priority(int prio) { _native_priority = prio; } | 66 void set_native_priority(int prio) { _native_priority = prio; } |
69 | 67 |
70 // *************************************************************** | 68 // *************************************************************** |
71 // interrupt support. interrupts (using signals) are used to get | 69 // interrupt support. interrupts (using signals) are used to get |