From 2c31c8eeb42188ad6fd15eca50db4342cd791fb2 Mon Sep 17 00:00:00 2001 From: Fredrik Bredberg Date: Thu, 24 Oct 2024 09:51:24 +0000 Subject: [PATCH] 8339730: Windows regression after removing ObjectMonitor Responsible Reviewed-by: coleenp, jwaters --- src/hotspot/os/windows/os_windows.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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); }