diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 66a6a92f5e0..4dafef0c098 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -5753,7 +5753,15 @@ void PlatformEvent::park() { // TODO: consider a brief spin here, gated on the success of recent // spin attempts by this thread. while (_Event < 0) { + // The following code is only here to maintain the + // characteristics/performance from when an ObjectMonitor + // "responsible" thread used to issue timed parks. + HighResolutionInterval *phri = nullptr; + if (!ForceTimeHighResolution) { + phri = new HighResolutionInterval((jlong)1); + } DWORD rv = ::WaitForSingleObject(_ParkHandle, INFINITE); + delete phri; // if it is null, harmless assert(rv != WAIT_FAILED, "WaitForSingleObject failed with error code: %lu", GetLastError()); assert(rv == WAIT_OBJECT_0, "WaitForSingleObject failed with return value: %lu", rv); }