|
26 | 26 | #ifndef OS_AIX_OSTHREAD_AIX_HPP
|
27 | 27 | #define OS_AIX_OSTHREAD_AIX_HPP
|
28 | 28 |
|
29 |
| - public: |
30 |
| - typedef pthread_t thread_id_t; |
31 |
| - |
32 |
| - private: |
33 |
| - int _thread_type; |
| 29 | +#include "runtime/osThreadBase.hpp" |
| 30 | +#include "suspendResume_posix.hpp" |
| 31 | +#include "utilities/globalDefinitions.hpp" |
34 | 32 |
|
35 |
| - public: |
| 33 | +class OSThread : public OSThreadBase { |
| 34 | + friend class VMStructs; |
36 | 35 |
|
37 |
| - int thread_type() const { |
38 |
| - return _thread_type; |
39 |
| - } |
40 |
| - void set_thread_type(int type) { |
41 |
| - _thread_type = type; |
42 |
| - } |
| 36 | + typedef pthread_t thread_id_t; |
43 | 37 |
|
44 |
| - private: |
| 38 | + thread_id_t _thread_id; |
| 39 | + int _thread_type; |
45 | 40 |
|
46 | 41 | // On AIX, we use the pthread id as OSThread::thread_id and keep the kernel thread id
|
47 | 42 | // separately for diagnostic purposes.
|
|
54 | 49 | sigset_t _caller_sigmask; // Caller's signal mask
|
55 | 50 |
|
56 | 51 | public:
|
| 52 | + OSThread(); |
| 53 | + ~OSThread(); |
| 54 | + |
| 55 | + int thread_type() const { |
| 56 | + return _thread_type; |
| 57 | + } |
| 58 | + void set_thread_type(int type) { |
| 59 | + _thread_type = type; |
| 60 | + } |
57 | 61 |
|
58 | 62 | // Methods to save/restore caller's signal mask
|
59 | 63 | sigset_t caller_sigmask() const { return _caller_sigmask; }
|
60 | 64 | void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; }
|
61 | 65 |
|
62 |
| -#ifndef PRODUCT |
63 |
| - // Used for debugging, return a unique integer for each thread. |
64 |
| - int thread_identifier() const { return _thread_id; } |
65 |
| -#endif |
| 66 | + thread_id_t thread_id() const { |
| 67 | + return _thread_id; |
| 68 | + } |
| 69 | + void set_thread_id(thread_id_t id) { |
| 70 | + _thread_id = id; |
| 71 | + } |
| 72 | + |
66 | 73 | tid_t kernel_thread_id() const {
|
67 | 74 | return _kernel_thread_id;
|
68 | 75 | }
|
|
71 | 78 | }
|
72 | 79 |
|
73 | 80 | pthread_t pthread_id() const {
|
74 |
| - // Here: same as OSThread::thread_id() |
| 81 | + // Here: same as thread_id() |
75 | 82 | return _thread_id;
|
76 | 83 | }
|
77 | 84 |
|
78 | 85 | // ***************************************************************
|
79 | 86 | // suspension support.
|
80 | 87 | // ***************************************************************
|
81 | 88 |
|
82 |
| - public: |
83 | 89 | // flags that support signal based suspend/resume on Aix are in a
|
84 | 90 | // separate class to avoid confusion with many flags in OSThread that
|
85 | 91 | // are used by VM level suspend/resume.
|
|
125 | 131 | return _startThread_lock;
|
126 | 132 | }
|
127 | 133 |
|
128 |
| - // *************************************************************** |
129 |
| - // Platform dependent initialization and cleanup |
130 |
| - // *************************************************************** |
131 |
| - |
132 |
| - private: |
133 |
| - |
134 |
| - void pd_initialize(); |
135 |
| - void pd_destroy(); |
136 |
| - |
137 |
| - public: |
138 |
| - |
139 | 134 | // The last measured values of cpu timing to prevent the "stale
|
140 | 135 | // value return" bug in thread_cpu_time.
|
141 | 136 | volatile struct {
|
142 | 137 | jlong sys;
|
143 | 138 | jlong user;
|
144 | 139 | } _last_cpu_times;
|
145 | 140 |
|
| 141 | + // Printing |
| 142 | + uintx thread_id_for_printing() const override { |
| 143 | + return (uintx)_thread_id; |
| 144 | + } |
| 145 | +}; |
| 146 | + |
146 | 147 | #endif // OS_AIX_OSTHREAD_AIX_HPP
|
0 commit comments