[Lldb-commits] [lldb] [lldb] Adding file and pipe support to lldb_private::MainLoopWindows. (PR #145621)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 27 02:07:01 PDT 2025


================
@@ -31,6 +36,127 @@ static DWORD ToTimeout(std::optional<MainLoopWindows::TimePoint> point) {
   return ceil<milliseconds>(dur).count();
 }
 
+class PipeFdInfo : public MainLoopWindows::FdInfo {
+public:
+  explicit PipeFdInfo(HANDLE handle, MainLoopBase::Callback callback)
+      : FdInfo((intptr_t)CreateEventW(NULL, /*bManualReset=*/FALSE,
+                                      /*bInitialState=*/FALSE, NULL),
+               callback),
+        handle(handle), ready(CreateEventW(NULL, /*bManualReset=*/FALSE,
+                                           /*bInitialState=*/FALSE, NULL)) {
+    assert(event && ready);
+  }
+
+  ~PipeFdInfo() override {
+    if (monitor_thread.joinable()) {
----------------
labath wrote:

Can we drop the read thread? Did [this implementation](https://github.com/llvm/llvm-project/commit/6675e03763c7d64e3335f1582c0fd7bc639be7d7) not work? I believe it should be possible to plug the event from the read operation into the WaitForMultipleObjects call.

https://github.com/llvm/llvm-project/pull/145621


More information about the lldb-commits mailing list