8339730: Windows regression after removing ObjectMonitor Responsible

Reviewed-by: coleenp, jwaters
This commit is contained in:
Fredrik Bredberg 2024-10-24 09:51:24 +00:00
parent f0b130e54f
commit 2c31c8eeb4

View File

@ -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);
}