[Lldb-commits] [lldb] [lldb] Adding pipe support to lldb_private::MainLoopWindows. (PR #145621)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 7 09:33:46 PDT 2025
================
@@ -44,26 +163,20 @@ MainLoopWindows::~MainLoopWindows() {
}
llvm::Expected<size_t> MainLoopWindows::Poll() {
- std::vector<WSAEVENT> events;
+ std::vector<HANDLE> events;
events.reserve(m_read_fds.size() + 1);
- for (auto &[fd, info] : m_read_fds) {
- int result = WSAEventSelect(fd, info.event, FD_READ | FD_ACCEPT | FD_CLOSE);
- assert(result == 0);
- UNUSED_IF_ASSERT_DISABLED(result);
-
- events.push_back(info.event);
+ for (auto &[_, fd_info] : m_read_fds) {
+ fd_info.event->WillPoll();
+ events.push_back((HANDLE)fd_info.event->GetHandle());
}
events.push_back(m_interrupt_event);
DWORD result =
WSAWaitForMultipleEvents(events.size(), events.data(), FALSE,
----------------
ashgti wrote:
WSAWaitForMultipleEvents is calling WaitForMultipleObjectsEx per the Remarks section of https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsawaitformultipleevents#remarks and the `lphEvents` param supports taking different HANDLE types. `WSAEVENT` is just a typedef on `HANDLE`, so they can be used in the same places in a few different APIs.
https://github.com/llvm/llvm-project/pull/145621
More information about the lldb-commits
mailing list