File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ class DeadlockDetectorTLS {
120
120
u32 lock;
121
121
u32 stk;
122
122
};
123
- LockWithContext all_locks_with_contexts_[64 ];
123
+ LockWithContext all_locks_with_contexts_[128 ];
124
124
uptr n_all_locks_;
125
125
};
126
126
Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx_tsan %s -fsanitize=thread -o %t && %run %t 2>&1 | Filecheck %s
2
+
3
+ #include < mutex>
4
+ #include < stdio.h>
5
+
6
+ int main (){
7
+ const unsigned short NUM_OF_MTX = 128 ;
8
+ std::mutex mutexes[NUM_OF_MTX];
9
+
10
+ for (int i = 0 ; i < NUM_OF_MTX; i++){
11
+ mutexes[i].lock ();
12
+ }
13
+ for (int i = 0 ; i < NUM_OF_MTX; i++){
14
+ mutexes[i].unlock ();
15
+ }
16
+
17
+ printf (" Success\n " );
18
+
19
+ return 0 ;
20
+ }
21
+
22
+ // CHECK: Success
23
+ // CHECK-NOT: ThreadSanitizer: CHECK failed
You can’t perform that action at this time.
0 commit comments