1286 !SafepointSynchronize::is_at_safepoint() && |
1286 !SafepointSynchronize::is_at_safepoint() && |
1287 this != Interrupt_lock && this != ProfileVM_lock && |
1287 this != Interrupt_lock && this != ProfileVM_lock && |
1288 !(this == Safepoint_lock && contains(locks, Terminator_lock) && |
1288 !(this == Safepoint_lock && contains(locks, Terminator_lock) && |
1289 SafepointSynchronize::is_synchronizing())) { |
1289 SafepointSynchronize::is_synchronizing())) { |
1290 new_owner->print_owned_locks(); |
1290 new_owner->print_owned_locks(); |
1291 fatal4("acquiring lock %s/%d out of order with lock %s/%d -- possible deadlock", |
1291 fatal(err_msg("acquiring lock %s/%d out of order with lock %s/%d -- " |
1292 this->name(), this->rank(), locks->name(), locks->rank()); |
1292 "possible deadlock", this->name(), this->rank(), |
|
1293 locks->name(), locks->rank())); |
1293 } |
1294 } |
1294 |
1295 |
1295 this->_next = new_owner->_owned_locks; |
1296 this->_next = new_owner->_owned_locks; |
1296 new_owner->_owned_locks = this; |
1297 new_owner->_owned_locks = this; |
1297 #endif |
1298 #endif |
1340 void Monitor::check_prelock_state(Thread *thread) { |
1341 void Monitor::check_prelock_state(Thread *thread) { |
1341 assert((!thread->is_Java_thread() || ((JavaThread *)thread)->thread_state() == _thread_in_vm) |
1342 assert((!thread->is_Java_thread() || ((JavaThread *)thread)->thread_state() == _thread_in_vm) |
1342 || rank() == Mutex::special, "wrong thread state for using locks"); |
1343 || rank() == Mutex::special, "wrong thread state for using locks"); |
1343 if (StrictSafepointChecks) { |
1344 if (StrictSafepointChecks) { |
1344 if (thread->is_VM_thread() && !allow_vm_block()) { |
1345 if (thread->is_VM_thread() && !allow_vm_block()) { |
1345 fatal1("VM thread using lock %s (not allowed to block on)", name()); |
1346 fatal(err_msg("VM thread using lock %s (not allowed to block on)", |
|
1347 name())); |
1346 } |
1348 } |
1347 debug_only(if (rank() != Mutex::special) \ |
1349 debug_only(if (rank() != Mutex::special) \ |
1348 thread->check_for_valid_safepoint_state(false);) |
1350 thread->check_for_valid_safepoint_state(false);) |
1349 } |
1351 } |
1350 } |
1352 } |