< prev index next >
src/hotspot/share/runtime/objectMonitor.cpp
Print this page
*** 2086,2096 ****
}
// NotRunnable() -- informed spinning
//
// Don't bother spinning if the owner is not eligible to drop the lock.
- // Peek at the owner's schedctl.sc_state and Thread._thread_values and
// spin only if the owner thread is _thread_in_Java or _thread_in_vm.
// The thread must be runnable in order to drop the lock in timely fashion.
// If the _owner is not runnable then spinning will not likely be
// successful (profitable).
//
--- 2086,2095 ----
*** 2108,2124 ****
// with the LSB of _owner. Another option would be to probablistically probe
// the putative _owner->TypeTag value.
//
// Checking _thread_state isn't perfect. Even if the thread is
// in_java it might be blocked on a page-fault or have been preempted
! // and sitting on a ready/dispatch queue. _thread state in conjunction
! // with schedctl.sc_state gives us a good picture of what the
! // thread is doing, however.
! //
! // TODO: check schedctl.sc_state.
! // We'll need to use SafeFetch32() to read from the schedctl block.
! // See RFE #5004247 and http://sac.sfbay.sun.com/Archives/CaseLog/arc/PSARC/2005/351/
//
// The return value from NotRunnable() is *advisory* -- the
// result is based on sampling and is not necessarily coherent.
// The caller must tolerate false-negative and false-positive errors.
// Spinning, in general, is probabilistic anyway.
--- 2107,2117 ----
// with the LSB of _owner. Another option would be to probablistically probe
// the putative _owner->TypeTag value.
//
// Checking _thread_state isn't perfect. Even if the thread is
// in_java it might be blocked on a page-fault or have been preempted
! // and sitting on a ready/dispatch queue.
//
// The return value from NotRunnable() is *advisory* -- the
// result is based on sampling and is not necessarily coherent.
// The caller must tolerate false-negative and false-positive errors.
// Spinning, in general, is probabilistic anyway.
< prev index next >