[compiler-rt] [TSan] Increase the number of simultaneously locked mutexes that a thread can hold (PR #116409)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 15 08:59:47 PST 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 af3295bd3dccd91c102d6a9b0d30c30844967e02 a2561d5878a02b6955f48a38434c2cc056dd6459 --extensions cpp,h -- compiler-rt/test/tsan/many_held_mutex.cpp compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/test/tsan/many_held_mutex.cpp b/compiler-rt/test/tsan/many_held_mutex.cpp
index 479aa20a7b..61bfb95c1b 100644
--- a/compiler-rt/test/tsan/many_held_mutex.cpp
+++ b/compiler-rt/test/tsan/many_held_mutex.cpp
@@ -3,20 +3,20 @@
#include <mutex>
#include <stdio.h>
-int main(){
- const unsigned short NUM_OF_MTX = 128;
- std::mutex mutexes[NUM_OF_MTX];
+int main() {
+ const unsigned short NUM_OF_MTX = 128;
+ std::mutex mutexes[NUM_OF_MTX];
- for(int i = 0; i < NUM_OF_MTX; i++){
- mutexes[i].lock();
- }
- for(int i = 0; i < NUM_OF_MTX; i++){
- mutexes[i].unlock();
- }
+ for (int i = 0; i < NUM_OF_MTX; i++) {
+ mutexes[i].lock();
+ }
+ for (int i = 0; i < NUM_OF_MTX; i++) {
+ mutexes[i].unlock();
+ }
- printf("Success\n");
+ printf("Success\n");
- return 0;
+ return 0;
}
// CHECK: Success
``````````
</details>
https://github.com/llvm/llvm-project/pull/116409
More information about the llvm-commits
mailing list