src/hotspot/share/runtime/thread.cpp
changeset 57840 4863a802a7c1
parent 57777 90ead0febf56
child 57906 e17f768b3b71
equal deleted inserted replaced
57831:d41c18a68257 57840:4863a802a7c1
   969   st->print(INTPTR_FORMAT, p2i(this));   // print address
   969   st->print(INTPTR_FORMAT, p2i(this));   // print address
   970 }
   970 }
   971 
   971 
   972 #ifdef ASSERT
   972 #ifdef ASSERT
   973 void Thread::print_owned_locks_on(outputStream* st) const {
   973 void Thread::print_owned_locks_on(outputStream* st) const {
   974   Monitor *cur = _owned_locks;
   974   Mutex* cur = _owned_locks;
   975   if (cur == NULL) {
   975   if (cur == NULL) {
   976     st->print(" (no locks) ");
   976     st->print(" (no locks) ");
   977   } else {
   977   } else {
   978     st->print_cr(" Locks owned:");
   978     st->print_cr(" Locks owned:");
   979     while (cur) {
   979     while (cur) {
  1009   }
  1009   }
  1010 
  1010 
  1011   if (potential_vm_operation && !Universe::is_bootstrapping()) {
  1011   if (potential_vm_operation && !Universe::is_bootstrapping()) {
  1012     // Make sure we do not hold any locks that the VM thread also uses.
  1012     // Make sure we do not hold any locks that the VM thread also uses.
  1013     // This could potentially lead to deadlocks
  1013     // This could potentially lead to deadlocks
  1014     for (Monitor *cur = _owned_locks; cur; cur = cur->next()) {
  1014     for (Mutex* cur = _owned_locks; cur; cur = cur->next()) {
  1015       // Threads_lock is special, since the safepoint synchronization will not start before this is
  1015       // Threads_lock is special, since the safepoint synchronization will not start before this is
  1016       // acquired. Hence, a JavaThread cannot be holding it at a safepoint. So is VMOperationRequest_lock,
  1016       // acquired. Hence, a JavaThread cannot be holding it at a safepoint. So is VMOperationRequest_lock,
  1017       // since it is used to transfer control between JavaThreads and the VMThread
  1017       // since it is used to transfer control between JavaThreads and the VMThread
  1018       // Do not *exclude* any locks unless you are absolutely sure it is correct. Ask someone else first!
  1018       // Do not *exclude* any locks unless you are absolutely sure it is correct. Ask someone else first!
  1019       if ((cur->allow_vm_block() &&
  1019       if ((cur->allow_vm_block() &&