src/hotspot/os/posix/os_posix.cpp
changeset 59105 76ae9aa0e794
parent 58744 c9c3bb79861e
child 59251 4cbfa5077d68
equal deleted inserted replaced
59104:046e4024e55a 59105:76ae9aa0e794
  2073   // In particular a thread must never block on the Threads_lock while
  2073   // In particular a thread must never block on the Threads_lock while
  2074   // holding the Parker:: mutex.  If safepoints are pending both the
  2074   // holding the Parker:: mutex.  If safepoints are pending both the
  2075   // the ThreadBlockInVM() CTOR and DTOR may grab Threads_lock.
  2075   // the ThreadBlockInVM() CTOR and DTOR may grab Threads_lock.
  2076   ThreadBlockInVM tbivm(jt);
  2076   ThreadBlockInVM tbivm(jt);
  2077 
  2077 
       
  2078   // Can't access interrupt state now that we are _thread_blocked. If we've
       
  2079   // been interrupted since we checked above then _counter will be > 0.
       
  2080 
  2078   // Don't wait if cannot get lock since interference arises from
  2081   // Don't wait if cannot get lock since interference arises from
  2079   // unparking. Also re-check interrupt before trying wait.
  2082   // unparking.
  2080   if (jt->is_interrupted(false) ||
  2083   if (pthread_mutex_trylock(_mutex) != 0) {
  2081       pthread_mutex_trylock(_mutex) != 0) {
       
  2082     return;
  2084     return;
  2083   }
  2085   }
  2084 
  2086 
  2085   int status;
  2087   int status;
  2086   if (_counter > 0)  { // no wait needed
  2088   if (_counter > 0)  { // no wait needed