[libc-commits] [libc] [libc] implement PI mutex (PR #199393)
via libc-commits
libc-commits at lists.llvm.org
Sat May 23 19:09:00 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/linux/pi_mutex.h libc/include/llvm-libc-macros/pthread-macros.h libc/include/llvm-libc-types/__mutex_type.h libc/src/__support/threads/unix_mutex.h libc/src/pthread/pthread_mutex_init.cpp libc/src/pthread/pthread_mutexattr.h libc/test/integration/src/pthread/pthread_mutex_test.cpp --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/test/integration/src/pthread/pthread_mutex_test.cpp b/libc/test/integration/src/pthread/pthread_mutex_test.cpp
index 21181ecf0..f28686411 100644
--- a/libc/test/integration/src/pthread/pthread_mutex_test.cpp
+++ b/libc/test/integration/src/pthread/pthread_mutex_test.cpp
@@ -15,10 +15,10 @@
#include "src/pthread/pthread_mutex_lock.h"
#include "src/pthread/pthread_mutex_trylock.h"
#include "src/pthread/pthread_mutex_unlock.h"
+#include "src/pthread/pthread_mutexattr.h"
#include "src/pthread/pthread_mutexattr_destroy.h"
#include "src/pthread/pthread_mutexattr_init.h"
#include "src/pthread/pthread_mutexattr_settype.h"
-#include "src/pthread/pthread_mutexattr.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include "test/IntegrationTest/test.h"
@@ -39,8 +39,8 @@ static pthread_mutex_t snapshot_mutex(const void *mutex_storage) {
static void set_priority_inherit(pthread_mutexattr_t *attr,
bool priority_inherit) {
if (priority_inherit)
- *attr |= unsigned(
- LIBC_NAMESPACE::PThreadMutexAttrPos::PRIORITY_INHERIT_MASK);
+ *attr |=
+ unsigned(LIBC_NAMESPACE::PThreadMutexAttrPos::PRIORITY_INHERIT_MASK);
}
static void init_mutex(pthread_mutex_t *mutex, bool priority_inherit) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/199393
More information about the libc-commits
mailing list