133 char _name[MONITOR_NAME_LEN]; // Name of mutex |
133 char _name[MONITOR_NAME_LEN]; // Name of mutex |
134 |
134 |
135 // Debugging fields for naming, deadlock detection, etc. (some only used in debug mode) |
135 // Debugging fields for naming, deadlock detection, etc. (some only used in debug mode) |
136 #ifndef PRODUCT |
136 #ifndef PRODUCT |
137 bool _allow_vm_block; |
137 bool _allow_vm_block; |
138 debug_only(int _rank;) // rank (to avoid/detect potential deadlocks) |
138 DEBUG_ONLY(int _rank;) // rank (to avoid/detect potential deadlocks) |
139 debug_only(Monitor * _next;) // Used by a Thread to link up owned locks |
139 DEBUG_ONLY(Monitor * _next;) // Used by a Thread to link up owned locks |
140 debug_only(Thread* _last_owner;) // the last thread to own the lock |
140 DEBUG_ONLY(Thread* _last_owner;) // the last thread to own the lock |
141 debug_only(static bool contains(Monitor * locks, Monitor * lock);) |
141 DEBUG_ONLY(static bool contains(Monitor * locks, Monitor * lock);) |
142 debug_only(static Monitor * get_least_ranked_lock(Monitor * locks);) |
142 DEBUG_ONLY(static Monitor * get_least_ranked_lock(Monitor * locks);) |
143 debug_only(Monitor * get_least_ranked_lock_besides_this(Monitor * locks);) |
143 DEBUG_ONLY(Monitor * get_least_ranked_lock_besides_this(Monitor * locks);) |
144 #endif |
144 #endif |
145 |
145 |
146 void set_owner_implementation(Thread* owner) PRODUCT_RETURN; |
146 void set_owner_implementation(Thread* owner) PRODUCT_RETURN; |
147 void check_prelock_state (Thread* thread, bool safepoint_check) PRODUCT_RETURN; |
147 void check_prelock_state (Thread* thread, bool safepoint_check) PRODUCT_RETURN; |
148 void check_block_state (Thread* thread) PRODUCT_RETURN; |
148 void check_block_state (Thread* thread) PRODUCT_RETURN; |
235 void print_on_error(outputStream* st) const; |
235 void print_on_error(outputStream* st) const; |
236 |
236 |
237 #ifndef PRODUCT |
237 #ifndef PRODUCT |
238 void print_on(outputStream* st) const; |
238 void print_on(outputStream* st) const; |
239 void print() const { print_on(tty); } |
239 void print() const { print_on(tty); } |
240 debug_only(int rank() const { return _rank; }) |
240 DEBUG_ONLY(int rank() const { return _rank; }) |
241 bool allow_vm_block() { return _allow_vm_block; } |
241 bool allow_vm_block() { return _allow_vm_block; } |
242 |
242 |
243 debug_only(Monitor *next() const { return _next; }) |
243 DEBUG_ONLY(Monitor *next() const { return _next; }) |
244 debug_only(void set_next(Monitor *next) { _next = next; }) |
244 DEBUG_ONLY(void set_next(Monitor *next) { _next = next; }) |
245 #endif |
245 #endif |
246 |
246 |
247 void set_owner(Thread* owner) { |
247 void set_owner(Thread* owner) { |
248 #ifndef PRODUCT |
248 #ifndef PRODUCT |
249 set_owner_implementation(owner); |
249 set_owner_implementation(owner); |
250 debug_only(void verify_Monitor(Thread* thr)); |
250 DEBUG_ONLY(void verify_Monitor(Thread* thr);) |
251 #else |
251 #else |
252 _owner = owner; |
252 _owner = owner; |
253 #endif |
253 #endif |
254 } |
254 } |
255 |
255 |