Skip to content

Commit 5ef56f1

Browse files
authored
[lldb] Adjust MainLoop on Win32 to work with mingw (#163419)
This adjusts the monitor tear down to only call CancelIoEx a single time, which should cancel all IO operations in the monitoring thread, instead of calling it in a loop. This removes the `m_monitor_thread.native_handle()` call that returns a different type on windows/mingw compiles with pthreads enabled and should fix #162801.
1 parent 0e4fb17 commit 5ef56f1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lldb/source/Host/windows/MainLoopWindows.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ class PipeEvent : public MainLoopWindows::IOEvent {
5555
if (m_monitor_thread.joinable()) {
5656
m_stopped = true;
5757
SetEvent(m_ready);
58-
// Keep trying to cancel ReadFile() until the thread exits.
59-
do {
60-
CancelIoEx(m_handle, /*lpOverlapped=*/NULL);
61-
} while (WaitForSingleObject(m_monitor_thread.native_handle(), 1) ==
62-
WAIT_TIMEOUT);
58+
CancelIoEx(m_handle, /*lpOverlapped=*/NULL);
6359
m_monitor_thread.join();
6460
}
6561
CloseHandle(m_event);

0 commit comments

Comments
 (0)