< prev index next >

src/share/vm/runtime/mutex.cpp

Print this page

        

*** 895,906 **** // of Mutex-Monitor and instead directly address the underlying design flaw. void Monitor::lock(Thread * Self) { // Ensure that the Monitor requires/allows safepoint checks. assert(_safepoint_check_required != Monitor::_safepoint_check_never, ! err_msg("This lock should never have a safepoint check: %s", ! name())); #ifdef CHECK_UNHANDLED_OOPS // Clear unhandled oops so we get a crash right away. Only clear for non-vm // or GC threads. if (Self->is_Java_thread()) { --- 895,905 ---- // of Mutex-Monitor and instead directly address the underlying design flaw. void Monitor::lock(Thread * Self) { // Ensure that the Monitor requires/allows safepoint checks. assert(_safepoint_check_required != Monitor::_safepoint_check_never, ! "This lock should never have a safepoint check: %s", name()); #ifdef CHECK_UNHANDLED_OOPS // Clear unhandled oops so we get a crash right away. Only clear for non-vm // or GC threads. if (Self->is_Java_thread()) {
*** 958,969 **** // thread state set to be in VM, the safepoint synchronization code will deadlock! void Monitor::lock_without_safepoint_check(Thread * Self) { // Ensure that the Monitor does not require or allow safepoint checks. assert(_safepoint_check_required != Monitor::_safepoint_check_always, ! err_msg("This lock should always have a safepoint check: %s", ! name())); assert(_owner != Self, "invariant"); ILock(Self); assert(_owner == NULL, "invariant"); set_owner(Self); } --- 957,967 ---- // thread state set to be in VM, the safepoint synchronization code will deadlock! void Monitor::lock_without_safepoint_check(Thread * Self) { // Ensure that the Monitor does not require or allow safepoint checks. assert(_safepoint_check_required != Monitor::_safepoint_check_always, ! "This lock should always have a safepoint check: %s", name()); assert(_owner != Self, "invariant"); ILock(Self); assert(_owner == NULL, "invariant"); set_owner(Self); }
*** 1091,1103 **** bool Monitor::wait(bool no_safepoint_check, long timeout, bool as_suspend_equivalent) { // Make sure safepoint checking is used properly. assert(!(_safepoint_check_required == Monitor::_safepoint_check_never && no_safepoint_check == false), ! err_msg("This lock should never have a safepoint check: %s", name())); assert(!(_safepoint_check_required == Monitor::_safepoint_check_always && no_safepoint_check == true), ! err_msg("This lock should always have a safepoint check: %s", name())); Thread * const Self = Thread::current(); assert(_owner == Self, "invariant"); assert(ILocked(), "invariant"); --- 1089,1101 ---- bool Monitor::wait(bool no_safepoint_check, long timeout, bool as_suspend_equivalent) { // Make sure safepoint checking is used properly. assert(!(_safepoint_check_required == Monitor::_safepoint_check_never && no_safepoint_check == false), ! "This lock should never have a safepoint check: %s", name()); assert(!(_safepoint_check_required == Monitor::_safepoint_check_always && no_safepoint_check == true), ! "This lock should always have a safepoint check: %s", name()); Thread * const Self = Thread::current(); assert(_owner == Self, "invariant"); assert(ILocked(), "invariant");
*** 1333,1345 **** !SafepointSynchronize::is_at_safepoint() && this != Interrupt_lock && this != ProfileVM_lock && !(this == Safepoint_lock && contains(locks, Terminator_lock) && SafepointSynchronize::is_synchronizing())) { new_owner->print_owned_locks(); ! fatal(err_msg("acquiring lock %s/%d out of order with lock %s/%d -- " "possible deadlock", this->name(), this->rank(), ! locks->name(), locks->rank())); } this->_next = new_owner->_owned_locks; new_owner->_owned_locks = this; #endif --- 1331,1343 ---- !SafepointSynchronize::is_at_safepoint() && this != Interrupt_lock && this != ProfileVM_lock && !(this == Safepoint_lock && contains(locks, Terminator_lock) && SafepointSynchronize::is_synchronizing())) { new_owner->print_owned_locks(); ! fatal("acquiring lock %s/%d out of order with lock %s/%d -- " "possible deadlock", this->name(), this->rank(), ! locks->name(), locks->rank()); } this->_next = new_owner->_owned_locks; new_owner->_owned_locks = this; #endif
*** 1384,1395 **** void Monitor::check_prelock_state(Thread *thread) { assert((!thread->is_Java_thread() || ((JavaThread *)thread)->thread_state() == _thread_in_vm) || rank() == Mutex::special, "wrong thread state for using locks"); if (StrictSafepointChecks) { if (thread->is_VM_thread() && !allow_vm_block()) { ! fatal(err_msg("VM thread using lock %s (not allowed to block on)", ! name())); } debug_only(if (rank() != Mutex::special) \ thread->check_for_valid_safepoint_state(false);) } if (thread->is_Watcher_thread()) { --- 1382,1392 ---- void Monitor::check_prelock_state(Thread *thread) { assert((!thread->is_Java_thread() || ((JavaThread *)thread)->thread_state() == _thread_in_vm) || rank() == Mutex::special, "wrong thread state for using locks"); if (StrictSafepointChecks) { if (thread->is_VM_thread() && !allow_vm_block()) { ! fatal("VM thread using lock %s (not allowed to block on)", name()); } debug_only(if (rank() != Mutex::special) \ thread->check_for_valid_safepoint_state(false);) } if (thread->is_Watcher_thread()) {
< prev index next >