[libc-commits] [libc] [libc] inline fast path of callonce (PR #96226)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Wed Jun 26 09:44:14 PDT 2024
================
@@ -7,27 +7,15 @@
//===----------------------------------------------------------------------===//
#include "src/__support/threads/callonce.h"
-#include "src/__support/macros/optimization.h"
#include "src/__support/threads/linux/futex_utils.h"
namespace LIBC_NAMESPACE {
-
-static constexpr FutexWordType NOT_CALLED = 0x0;
-static constexpr FutexWordType START = 0x11;
-static constexpr FutexWordType WAITING = 0x22;
-static constexpr FutexWordType FINISH = 0x33;
-
-int callonce(CallOnceFlag *flag, CallOnceCallback *func) {
+namespace callonce_impl {
----------------
nickdesaulniers wrote:
Please add an explicit include for `libc/src/__support/threads/linux/callonce.h` for the `NOT_CALLED` constants and friends. (prefer direct includes over indirect includes).
https://github.com/llvm/llvm-project/pull/96226
More information about the libc-commits
mailing list