Skip to content

Commit b262aa3

Browse files
Moving StartPoll
1 parent b9ceb61 commit b262aa3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lldb/source/Host/posix/MainLoopPosix.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class MainLoopPosix::RunImpl {
9999
~RunImpl() = default;
100100

101101
Status Poll();
102-
int StartPoll(std::optional<MainLoopPosix::TimePoint> point);
102+
103103
void ProcessReadEvents();
104104

105105
private:
@@ -160,10 +160,10 @@ MainLoopPosix::RunImpl::RunImpl(MainLoopPosix &loop) : loop(loop) {
160160
read_fds.reserve(loop.m_read_fds.size());
161161
}
162162

163-
int MainLoopPosix::RunImpl::StartPoll(
164-
std::optional<MainLoopPosix::TimePoint> point) {
163+
static int StartPoll(llvm::MutableArrayRef<struct pollfd> fds,
164+
std::optional<MainLoopPosix::TimePoint> point) {
165165
#if HAVE_PPOLL
166-
return ppoll(read_fds.data(), read_fds.size(), ToTimeSpec(point),
166+
return ppoll(fds.data(), fds.size(), ToTimeSpec(point),
167167
/*sigmask=*/nullptr);
168168
#else
169169
using namespace std::chrono;
@@ -172,7 +172,7 @@ int MainLoopPosix::RunImpl::StartPoll(
172172
nanoseconds dur = std::max(*point - steady_clock::now(), nanoseconds(0));
173173
timeout = ceil<milliseconds>(dur).count();
174174
}
175-
return poll(read_fds.data(), read_fds.size(), timeout);
175+
return poll(fds.data(), fds.size(), timeout);
176176
#endif
177177
}
178178

@@ -186,7 +186,7 @@ Status MainLoopPosix::RunImpl::Poll() {
186186
pfd.revents = 0;
187187
read_fds.push_back(pfd);
188188
}
189-
int ready = StartPoll(loop.GetNextWakeupTime());
189+
int ready = StartPoll(read_fds, loop.GetNextWakeupTime());
190190

191191
if (ready == -1 && errno != EINTR)
192192
return Status(errno, eErrorTypePOSIX);

0 commit comments

Comments
 (0)