Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/thread.hpp @ 702:b9fba36710f2
6699669: Hotspot server leaves synchronized block with monitor in bad state
Summary: Remove usage of _highest_lock field in Thread so that is_lock_owned won't depend on the correct update of that field.
Reviewed-by: never, dice, acorn
author | xlu |
---|---|
date | Mon, 06 Apr 2009 15:47:39 -0700 |
parents | ea20d7ce26b0 |
children | 821269eca479 |
comparison
equal
deleted
inserted
replaced
697:922aedc96ef5 | 702:b9fba36710f2 |
---|---|
198 friend class No_Safepoint_Verifier; | 198 friend class No_Safepoint_Verifier; |
199 friend class Pause_No_Safepoint_Verifier; | 199 friend class Pause_No_Safepoint_Verifier; |
200 friend class ThreadLocalStorage; | 200 friend class ThreadLocalStorage; |
201 friend class GC_locker; | 201 friend class GC_locker; |
202 | 202 |
203 // In order for all threads to be able to use fast locking, we need to know the highest stack | |
204 // address of where a lock is on the stack (stacks normally grow towards lower addresses). This | |
205 // variable is initially set to NULL, indicating no locks are used by the thread. During the thread's | |
206 // execution, it will be set whenever locking can happen, i.e., when we call out to Java code or use | |
207 // an ObjectLocker. The value is never decreased, hence, it will over the lifetime of a thread | |
208 // approximate the real stackbase. | |
209 address _highest_lock; // Highest stack address where a JavaLock exist | |
210 | |
211 ThreadLocalAllocBuffer _tlab; // Thread-local eden | 203 ThreadLocalAllocBuffer _tlab; // Thread-local eden |
212 | 204 |
213 int _vm_operation_started_count; // VM_Operation support | 205 int _vm_operation_started_count; // VM_Operation support |
214 int _vm_operation_completed_count; // VM_Operation support | 206 int _vm_operation_completed_count; // VM_Operation support |
215 | 207 |
398 } | 390 } |
399 | 391 |
400 // Sweeper support | 392 // Sweeper support |
401 void nmethods_do(); | 393 void nmethods_do(); |
402 | 394 |
403 // Fast-locking support | |
404 address highest_lock() const { return _highest_lock; } | |
405 void update_highest_lock(address base) { if (base > _highest_lock) _highest_lock = base; } | |
406 | |
407 // Tells if adr belong to this thread. This is used | 395 // Tells if adr belong to this thread. This is used |
408 // for checking if a lock is owned by the running thread. | 396 // for checking if a lock is owned by the running thread. |
397 | |
398 // Used by fast lock support | |
399 virtual bool is_lock_owned(address adr) const; | |
400 | |
401 // Check if address is in the stack of the thread (not just for locks). | |
409 // Warning: the method can only be used on the running thread | 402 // Warning: the method can only be used on the running thread |
410 // Fast lock support uses these methods | |
411 virtual bool lock_is_in_stack(address adr) const; | |
412 virtual bool is_lock_owned(address adr) const; | |
413 | |
414 // Check if address is in the stack of the thread (not just for locks). | |
415 bool is_in_stack(address adr) const; | 403 bool is_in_stack(address adr) const; |
416 | 404 |
417 // Sets this thread as starting thread. Returns failure if thread | 405 // Sets this thread as starting thread. Returns failure if thread |
418 // creation fails due to lack of memory, too many threads etc. | 406 // creation fails due to lack of memory, too many threads etc. |
419 bool set_as_starting_thread(); | 407 bool set_as_starting_thread(); |