[Lldb-commits] [lldb] [lldb] Adding pipe support to lldb_private::MainLoopWindows. (PR #145621)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 30 02:45:52 PDT 2025
================
@@ -44,25 +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,
ToTimeout(GetNextWakeupTime()), FALSE);
- for (auto &fd : m_read_fds) {
- int result = WSAEventSelect(fd.first, WSA_INVALID_EVENT, 0);
- assert(result == 0);
- UNUSED_IF_ASSERT_DISABLED(result);
+ for (auto &[_, fd_info] : m_read_fds) {
+ fd_info.event->DidPoll();
}
----------------
labath wrote:
```suggestion
for (auto &[_, fd_info] : m_read_fds)
fd_info.event->DidPoll();
```
https://github.com/llvm/llvm-project/pull/145621
More information about the lldb-commits
mailing list