[libc-commits] [libc] [libc] rework mutex (PR #92168)

via libc-commits libc-commits at lists.llvm.org
Fri May 24 16:53:27 PDT 2024


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 cd9bab2e2acbdc22943703d5649dede72b09cad7 eac863224d1d90844366bd45dba173aa3dafab00 -- libc/hdr/types/pid_t.h libc/src/__support/threads/linux/raw_mutex.h libc/test/src/__support/threads/linux/raw_mutex_test.cpp libc/include/llvm-libc-types/cnd_t.h libc/src/__support/File/dir.h libc/src/__support/File/file.h libc/src/__support/threads/CndVar.h libc/src/__support/threads/fork_callbacks.cpp libc/src/__support/threads/gpu/mutex.h libc/src/__support/threads/linux/CndVar.cpp libc/src/__support/threads/linux/mutex.h libc/src/__support/threads/thread.cpp libc/src/pthread/pthread_mutex_init.cpp libc/src/pthread/pthread_mutexattr.h libc/src/stdlib/atexit.cpp libc/src/threads/mtx_init.cpp libc/test/integration/src/__support/threads/thread_detach_test.cpp
``````````

</details>

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

``````````diff
diff --git a/libc/test/src/__support/threads/linux/raw_mutex_test.cpp b/libc/test/src/__support/threads/linux/raw_mutex_test.cpp
index 0ec7a58c95..ddd3ddddc4 100644
--- a/libc/test/src/__support/threads/linux/raw_mutex_test.cpp
+++ b/libc/test/src/__support/threads/linux/raw_mutex_test.cpp
@@ -43,7 +43,7 @@ TEST(LlvmLibcSupportThreadsRawMutexTest, Timeout) {
   // Test that the mutex works after the timeout.
   ASSERT_TRUE(mutex.lock());
   ASSERT_TRUE(mutex.unlock());
-  // If a lock can be acquired directly, expired timeout will not count. 
+  // If a lock can be acquired directly, expired timeout will not count.
   // Notice that the timeout is already reached during preivous deadlock.
   ASSERT_TRUE(mutex.lock(*timeout));
   ASSERT_TRUE(mutex.unlock());

``````````

</details>


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


More information about the libc-commits mailing list