92 volatile bool interrupted() const { return _interrupted != 0; }
93 void set_interrupted(bool z) { _interrupted = z ? 1 : 0; }
94
95 // Printing
96 void print_on(outputStream* st) const;
97 void print() const { print_on(tty); }
98
99 // For java intrinsics:
100 static ByteSize interrupted_offset() { return byte_offset_of(OSThread, _interrupted); }
101
102 // Platform dependent stuff
103 #ifdef TARGET_OS_FAMILY_linux
104 # include "osThread_linux.hpp"
105 #endif
106 #ifdef TARGET_OS_FAMILY_solaris
107 # include "osThread_solaris.hpp"
108 #endif
109 #ifdef TARGET_OS_FAMILY_windows
110 # include "osThread_windows.hpp"
111 #endif
112
113 };
114
115
116 // Utility class for use with condition variables:
117 class OSThreadWaitState : public StackObj {
118 OSThread* _osthread;
119 ThreadState _old_state;
120 public:
121 OSThreadWaitState(OSThread* osthread, bool is_object_wait) {
122 _osthread = osthread;
123 _old_state = osthread->get_state();
124 if (is_object_wait) {
125 osthread->set_state(OBJECT_WAIT);
126 } else {
127 osthread->set_state(CONDVAR_WAIT);
128 }
129 }
130 ~OSThreadWaitState() {
131 _osthread->set_state(_old_state);
|
92 volatile bool interrupted() const { return _interrupted != 0; }
93 void set_interrupted(bool z) { _interrupted = z ? 1 : 0; }
94
95 // Printing
96 void print_on(outputStream* st) const;
97 void print() const { print_on(tty); }
98
99 // For java intrinsics:
100 static ByteSize interrupted_offset() { return byte_offset_of(OSThread, _interrupted); }
101
102 // Platform dependent stuff
103 #ifdef TARGET_OS_FAMILY_linux
104 # include "osThread_linux.hpp"
105 #endif
106 #ifdef TARGET_OS_FAMILY_solaris
107 # include "osThread_solaris.hpp"
108 #endif
109 #ifdef TARGET_OS_FAMILY_windows
110 # include "osThread_windows.hpp"
111 #endif
112 #ifdef TARGET_OS_FAMILY_bsd
113 # include "osThread_bsd.hpp"
114 #endif
115
116 };
117
118
119 // Utility class for use with condition variables:
120 class OSThreadWaitState : public StackObj {
121 OSThread* _osthread;
122 ThreadState _old_state;
123 public:
124 OSThreadWaitState(OSThread* osthread, bool is_object_wait) {
125 _osthread = osthread;
126 _old_state = osthread->get_state();
127 if (is_object_wait) {
128 osthread->set_state(OBJECT_WAIT);
129 } else {
130 osthread->set_state(CONDVAR_WAIT);
131 }
132 }
133 ~OSThreadWaitState() {
134 _osthread->set_state(_old_state);
|