[libc-commits] [libc] [libc] End a semaphore wait with EINTR when a signal handler runs (PR #236969)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Fri Oct 30 02:12:46 PDT 2026


================
@@ -89,10 +95,14 @@ class Futex : public cpp::Atomic<FutexWordType> {
           /*ignored=*/nullptr,
           /*bitset=*/FUTEX_BITSET_MATCH_ANY);
 
-      // continue waiting if interrupted; otherwise return the result
-      // which should normally be 0 or -ETIMEOUT.
-      if (ret == -EINTR)
-        continue;
+      // continue waiting if interrupted, unless the caller reports being
+      // interrupted itself; otherwise return the result which should normally
----------------
labath wrote:

I get what you're trying to say, but I think something like this is clearer.
```suggestion
      // continue waiting if interrupted, unless the caller asks to be notified; otherwise return the result which should normally
```

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


More information about the libc-commits mailing list