Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:48

0001 //===-- MainLoopWindows.h ---------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_HOST_WINDOWS_MAINLOOPWINDOWS_H
0010 #define LLDB_HOST_WINDOWS_MAINLOOPWINDOWS_H
0011 
0012 #include "lldb/Host/Config.h"
0013 #include "lldb/Host/MainLoopBase.h"
0014 #include <csignal>
0015 #include <list>
0016 #include <vector>
0017 
0018 namespace lldb_private {
0019 
0020 // Windows-specific implementation of the MainLoopBase class. It can monitor
0021 // socket descriptors for readability using WSAEventSelect. Non-socket file
0022 // descriptors are not supported.
0023 class MainLoopWindows : public MainLoopBase {
0024 public:
0025   MainLoopWindows();
0026   ~MainLoopWindows() override;
0027 
0028   ReadHandleUP RegisterReadObject(const lldb::IOObjectSP &object_sp,
0029                                   const Callback &callback,
0030                                   Status &error) override;
0031 
0032   Status Run() override;
0033 
0034 protected:
0035   void UnregisterReadObject(IOObject::WaitableHandle handle) override;
0036 
0037   void Interrupt() override;
0038 
0039 private:
0040   void ProcessReadObject(IOObject::WaitableHandle handle);
0041   llvm::Expected<size_t> Poll();
0042 
0043   struct FdInfo {
0044     void *event;
0045     Callback callback;
0046   };
0047   llvm::DenseMap<IOObject::WaitableHandle, FdInfo> m_read_fds;
0048   void *m_interrupt_event;
0049 };
0050 
0051 } // namespace lldb_private
0052 
0053 #endif // LLDB_HOST_WINDOWS_MAINLOOPWINDOWS_H