equal
deleted
inserted
replaced
60 friend class JVMCIVMStructs; |
60 friend class JVMCIVMStructs; |
61 private: |
61 private: |
62 OSThreadStartFunc _start_proc; // Thread start routine |
62 OSThreadStartFunc _start_proc; // Thread start routine |
63 void* _start_parm; // Thread start routine parameter |
63 void* _start_parm; // Thread start routine parameter |
64 volatile ThreadState _state; // Thread state *hint* |
64 volatile ThreadState _state; // Thread state *hint* |
65 volatile jint _interrupted; // Thread.isInterrupted state |
|
66 |
|
67 // Note: _interrupted must be jint, so that Java intrinsics can access it. |
|
68 // The value stored there must be either 0 or 1. It must be possible |
|
69 // for Java to emulate Thread.currentThread().isInterrupted() by performing |
|
70 // the double indirection Thread::current()->_osthread->_interrupted. |
|
71 |
65 |
72 // Methods |
66 // Methods |
73 public: |
67 public: |
74 void set_state(ThreadState state) { _state = state; } |
68 void set_state(ThreadState state) { _state = state; } |
75 ThreadState get_state() { return _state; } |
69 ThreadState get_state() { return _state; } |
80 // Accessors |
74 // Accessors |
81 OSThreadStartFunc start_proc() const { return _start_proc; } |
75 OSThreadStartFunc start_proc() const { return _start_proc; } |
82 void set_start_proc(OSThreadStartFunc start_proc) { _start_proc = start_proc; } |
76 void set_start_proc(OSThreadStartFunc start_proc) { _start_proc = start_proc; } |
83 void* start_parm() const { return _start_parm; } |
77 void* start_parm() const { return _start_parm; } |
84 void set_start_parm(void* start_parm) { _start_parm = start_parm; } |
78 void set_start_parm(void* start_parm) { _start_parm = start_parm; } |
85 // These are specialized on Windows. |
79 // This is specialized on Windows. |
86 #ifndef _WINDOWS |
80 #ifndef _WINDOWS |
87 volatile bool interrupted() const { return _interrupted != 0; } |
81 void set_interrupted(bool z) { /* nothing to do */ } |
88 void set_interrupted(bool z) { _interrupted = z ? 1 : 0; } |
|
89 #endif |
82 #endif |
90 // Printing |
83 // Printing |
91 void print_on(outputStream* st) const; |
84 void print_on(outputStream* st) const; |
92 void print() const; |
85 void print() const; |
93 |
|
94 // For java intrinsics: |
|
95 static ByteSize interrupted_offset() { return byte_offset_of(OSThread, _interrupted); } |
|
96 |
86 |
97 // Platform dependent stuff |
87 // Platform dependent stuff |
98 #include OS_HEADER(osThread) |
88 #include OS_HEADER(osThread) |
99 |
89 |
100 public: |
90 public: |