[Lldb-commits] [PATCH] D32600: Resurrect pselect MainLoop implementation
Zachary Turner via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 27 15:07:51 PDT 2017
zturner added inline comments.
================
Comment at: source/Host/common/MainLoop.cpp:135
+
+template <typename F> void MainLoop::RunImpl::ForEachReadFD(F &&f) {
+ assert(num_events >= 0);
----------------
Why do we need this function? Just have a function that returns an `ArrayRef<int>` and let the caller iterate over it themselves.
================
Comment at: source/Host/common/MainLoop.cpp:143
+}
+template <typename F> void MainLoop::RunImpl::ForEachSignal(F && f) {}
+#else
----------------
Same here.
================
Comment at: source/Host/common/MainLoop.cpp:167
+
+#ifdef FORCE_PSELECT
+ fd_set read_fd_set;
----------------
How about just moving this `#ifdef` up outside of the Poll function? Given that it occurs so many times, i think it makes the logic and the differences between the two implementations easier to follow.
https://reviews.llvm.org/D32600
More information about the lldb-commits
mailing list