[libc-commits] [libc] [libc][threads] adjust futex library and expose requeue API (PR #192478)

via libc-commits libc-commits at lists.llvm.org
Thu Apr 16 08:54:32 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- libc/src/__support/threads/futex_utils.h libc/test/src/__support/threads/futex_utils_test.cpp libc/src/__support/threads/CndVar.h libc/src/__support/threads/darwin/futex_utils.h libc/src/__support/threads/linux/futex_utils.h libc/src/__support/threads/raw_mutex.h libc/src/semaphore/posix_semaphore.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/__support/threads/CndVar.h b/libc/src/__support/threads/CndVar.h
index f7f0bb6c5..a423b65bf 100644
--- a/libc/src/__support/threads/CndVar.h
+++ b/libc/src/__support/threads/CndVar.h
@@ -11,7 +11,7 @@
 
 #include "hdr/stdint_proxy.h" // uint32_t
 #include "src/__support/macros/config.h"
-#include "src/__support/threads/futex_utils.h" // Futex
+#include "src/__support/threads/futex_utils.h"       // Futex
 #include "src/__support/threads/mutex.h"             // Mutex
 #include "src/__support/threads/raw_mutex.h"         // RawMutex
 
diff --git a/libc/src/__support/threads/darwin/futex_utils.h b/libc/src/__support/threads/darwin/futex_utils.h
index 6ce368a70..464d78a83 100644
--- a/libc/src/__support/threads/darwin/futex_utils.h
+++ b/libc/src/__support/threads/darwin/futex_utils.h
@@ -79,8 +79,7 @@ struct Futex : public cpp::Atomic<FutexWordType> {
 
   LIBC_INLINE ErrorOr<int> requeue_to(Futex & /*other*/,
                                       cpp::optional<FutexWordType> /*oldval*/,
-                                      int /*wake_limit*/,
-                                      int /*requeue_limit*/,
+                                      int /*wake_limit*/, int /*requeue_limit*/,
                                       bool /*is_shared*/ = false) {
     return cpp::unexpected(ENOSYS);
   }

``````````

</details>


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


More information about the libc-commits mailing list