[Lldb-commits] [lldb] [lldb] Unify/improve MainLoop signal handling (PR #115197)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 15 01:37:02 PST 2024


================
@@ -179,55 +142,34 @@ Status MainLoopPosix::RunImpl::Poll() {
     read_fds.push_back(pfd);
   }
 
-  if (ppoll(read_fds.data(), read_fds.size(), nullptr, &sigmask) == -1 &&
+  if (ppoll(read_fds.data(), read_fds.size(),
+            /*timeout=*/nullptr,
----------------
labath wrote:

I don't see what that would solve. The goal is to sleep until one of the FDs is readable. If none of them is, the only thing we can do is go back to sleep. Sure, we can have a bug where we e.g. somehow fail to notify the pipe about a signal, but that can also happen with a spurious wakeup (cause then you have to check if the signal really occurred, and maybe the bug is that you forgot to set that flag).

FWIW, there will be a timeout here after #112895 (but there is still the possibility of an infinite wait if/when there are no scheduled callbacks).

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


More information about the lldb-commits mailing list