[libc-commits] [libc] [libc] Introduce MCS-based Flat-Combining Lambda Lock (PR #101916)
via libc-commits
libc-commits at lists.llvm.org
Mon Aug 5 09:18:40 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 da0e66e64c39bf43d143ef271c301e49a5a5d2f4 c674522f73c969597d5f2f74023bb7ceb3004a9a --extensions cpp,h -- libc/src/__support/threads/lambda_lock.h libc/test/integration/src/__support/threads/lambda_lock_test.cpp libc/src/__support/CPP/atomic.h libc/src/__support/threads/spin_lock.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/test/integration/src/__support/threads/lambda_lock_test.cpp b/libc/test/integration/src/__support/threads/lambda_lock_test.cpp
index 657343c502..ad00302da9 100644
--- a/libc/test/integration/src/__support/threads/lambda_lock_test.cpp
+++ b/libc/test/integration/src/__support/threads/lambda_lock_test.cpp
@@ -33,8 +33,7 @@ void simple_addition() {
ASSERT_EQ(sum.get_unsafe(), 4995000);
}
-template <size_t LIMIT>
-void string_concat() {
+template <size_t LIMIT> void string_concat() {
static char buffer[10001];
LIBC_NAMESPACE::LambdaLock<LIBC_NAMESPACE::cpp::StringStream> shared{buffer};
pthread_t threads[10];
@@ -46,7 +45,8 @@ void string_concat() {
for (int j = 0; j < 100; ++j)
for (int c = 0; c < 10; ++c)
lock->enqueue(
- [c](LIBC_NAMESPACE::cpp::StringStream &data) { data << c; }, LIMIT);
+ [c](LIBC_NAMESPACE::cpp::StringStream &data) { data << c; },
+ LIMIT);
return nullptr;
},
&shared);
``````````
</details>
https://github.com/llvm/llvm-project/pull/101916
More information about the libc-commits
mailing list