提交 2c9bc3fb 编写于 作者: D dcubed

8038274: update 8u fix for 8028073 now that 8028280 is backported to 8u

Reviewed-by: coleenp, sspitsyn
上级 0421bb85
...@@ -1600,33 +1600,25 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) { ...@@ -1600,33 +1600,25 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
// post monitor waited event. Note that this is past-tense, we are done waiting. // post monitor waited event. Note that this is past-tense, we are done waiting.
if (JvmtiExport::should_post_monitor_waited()) { if (JvmtiExport::should_post_monitor_waited()) {
JvmtiExport::post_monitor_waited(jt, this, ret == OS_TIMEOUT); JvmtiExport::post_monitor_waited(jt, this, ret == OS_TIMEOUT);
}
// Without the fix for 8028280, it is possible for the above call: if (node._notified != 0 && _succ == Self) {
// // In this part of the monitor wait-notify-reenter protocol it
// Thread::SpinAcquire (&_WaitSetLock, "WaitSet - unlink") ; // is possible (and normal) for another thread to do a fastpath
// // monitor enter-exit while this thread is still trying to get
// to consume the unpark() that was done when the successor was set. // to the reenter portion of the protocol.
// The solution for this very rare possibility is to redo the unpark() //
// outside of the JvmtiExport::should_post_monitor_waited() check. // The ObjectMonitor was notified and the current thread is
// // the successor which also means that an unpark() has already
if (node._notified != 0 && _succ == Self) { // been done. The JVMTI_EVENT_MONITOR_WAITED event handler can
// In this part of the monitor wait-notify-reenter protocol it // consume the unpark() that was done when the successor was
// is possible (and normal) for another thread to do a fastpath // set because the same ParkEvent is shared between Java
// monitor enter-exit while this thread is still trying to get // monitors and JVM/TI RawMonitors (for now).
// to the reenter portion of the protocol. //
// // We redo the unpark() to ensure forward progress, i.e., we
// The ObjectMonitor was notified and the current thread is // don't want all pending threads hanging (parked) with none
// the successor which also means that an unpark() has already // entering the unlocked monitor.
// been done. The JVMTI_EVENT_MONITOR_WAITED event handler can node._event->unpark();
// consume the unpark() that was done when the successor was }
// set because the same ParkEvent is shared between Java
// monitors and JVM/TI RawMonitors (for now).
//
// We redo the unpark() to ensure forward progress, i.e., we
// don't want all pending threads hanging (parked) with none
// entering the unlocked monitor.
node._event->unpark();
} }
if (event.should_commit()) { if (event.should_commit()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册