Hi Alex,

It looks good in general.
+static HRESULT WaitForEvent(IDebugControl *ptrIDebugControl) {
+  // see JDK-8204994: sometimes WaitForEvent fails with E_ACCESSDENIED,
+  // but succeeded on 2nd call.
+  HRESULT hr = ptrIDebugControl->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
+  if (hr == E_ACCESSDENIED) {
+    // yield current thread use of a processor (short delay).
+    SwitchToThread();
+    hr = ptrIDebugControl->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
+  }
+  return hr;
+}

Can the ptrIDebugControl->WaitForEvent fail with E_ACCESSDENIED twice and succeed on third call?
Would it better to make it a loop with more retry attempts?

Thanks,
Serguei


On 5/27/20 13:54, Alex Menkov wrote:
Hi all,

please review the fix for
https://bugs.openjdk.java.net/browse/JDK-8204994
webrev:
http://cr.openjdk.java.net/~amenkov/jdk15/WinDbg_WaitForEvent/webrev/

--alex




Reply via email to