This patch switches the MainLoop class to use the WSAEventSelect mechanism to wait for multiple sockets to become readable. The motivation for doing that is that this allows us to wait for other kinds of events as well (as long as they can be converted to WSAEvents). This will allow us to avoid (abstract away) pipe-based multiplexing mechanisms in the generic code, since pipes cannot be combined with sockets on windows. Since the windows implementation will now look completely different than the posix (file descriptor-based) implementations, I have split the MainLoop class into two (MainLoopPosix and MainLoopWindows), with the common code going into MainLoopBase. Differential Revision: https://reviews.llvm.org/D131159
19 lines
616 B
C++
19 lines
616 B
C++
//===-- MainLoopBase.cpp --------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "lldb/Host/MainLoopBase.h"
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
void MainLoopBase::ProcessPendingCallbacks() {
|
|
for (const Callback &callback : m_pending_callbacks)
|
|
callback(*this);
|
|
m_pending_callbacks.clear();
|
|
}
|