@@ -239,7 +239,7 @@ void sls_fun_bad_1() {
239
239
}
240
240
241
241
void sls_fun_bad_2 () {
242
- sls_mu.Lock ();
242
+ sls_mu.Lock (); // expected-note{{mutex acquired here}}
243
243
sls_mu.Lock (); // \
244
244
// expected-warning{{acquiring mutex 'sls_mu' that is already held}}
245
245
sls_mu.Unlock ();
@@ -365,7 +365,7 @@ void aa_fun_bad_1() {
365
365
}
366
366
367
367
void aa_fun_bad_2 () {
368
- glock.globalLock ();
368
+ glock.globalLock (); // expected-note{{mutex acquired here}}
369
369
glock.globalLock (); // \
370
370
// expected-warning{{acquiring mutex 'aa_mu' that is already held}}
371
371
glock.globalUnlock ();
@@ -1691,7 +1691,7 @@ struct TestScopedLockable {
1691
1691
}
1692
1692
1693
1693
void foo3 () {
1694
- MutexLock mulock_a (&mu1);
1694
+ MutexLock mulock_a (&mu1); // expected-note{{mutex acquired here}}
1695
1695
MutexLock mulock_b (&mu1); // \
1696
1696
// expected-warning {{acquiring mutex 'mu1' that is already held}}
1697
1697
}
@@ -2710,14 +2710,14 @@ void doubleUnlock() {
2710
2710
}
2711
2711
2712
2712
void doubleLock1 () {
2713
- RelockableExclusiveMutexLock scope (&mu);
2713
+ RelockableExclusiveMutexLock scope (&mu); // expected-note{{mutex acquired here}}
2714
2714
scope.Lock (); // expected-warning {{acquiring mutex 'mu' that is already held}}
2715
2715
}
2716
2716
2717
2717
void doubleLock2 () {
2718
2718
RelockableExclusiveMutexLock scope (&mu);
2719
2719
scope.Unlock ();
2720
- scope.Lock ();
2720
+ scope.Lock (); // expected-note{{mutex acquired here}}
2721
2721
scope.Lock (); // expected-warning {{acquiring mutex 'mu' that is already held}}
2722
2722
}
2723
2723
@@ -2754,7 +2754,7 @@ class SCOPED_LOCKABLE MemberLock {
2754
2754
};
2755
2755
2756
2756
void relockShared2 () {
2757
- MemberLock lock;
2757
+ MemberLock lock; // expected-note{{mutex acquired here}}
2758
2758
lock.Lock (); // expected-warning {{acquiring mutex 'lock.mutex' that is already held}}
2759
2759
}
2760
2760
@@ -2861,7 +2861,7 @@ void join() EXCLUSIVE_LOCKS_REQUIRED(mu) {
2861
2861
2862
2862
void doubleLock () EXCLUSIVE_LOCKS_REQUIRED(mu) {
2863
2863
MutexUnlock scope (&mu);
2864
- scope.Lock ();
2864
+ scope.Lock (); // expected-note{{mutex acquired here}}
2865
2865
scope.Lock (); // expected-warning {{acquiring mutex 'mu' that is already held}}
2866
2866
}
2867
2867
@@ -3164,7 +3164,7 @@ void Foo::test7() {
3164
3164
3165
3165
3166
3166
void Foo::test8 () {
3167
- mu_->Lock ();
3167
+ mu_->Lock (); // expected-note 2 {{mutex acquired here}}
3168
3168
mu_.get ()->Lock (); // expected-warning {{acquiring mutex 'mu_' that is already held}}
3169
3169
(*mu_).Lock (); // expected-warning {{acquiring mutex 'mu_' that is already held}}
3170
3170
mu_.get ()->Unlock ();
@@ -3298,7 +3298,7 @@ void test0() {
3298
3298
foo.lock ();
3299
3299
foo.unlock ();
3300
3300
3301
- foo.lock ();
3301
+ foo.lock (); // expected-note{{mutex acquired here}}
3302
3302
foo.lock (); // expected-warning {{acquiring mutex 'foo' that is already held}}
3303
3303
foo.unlock ();
3304
3304
foo.unlock (); // expected-warning {{releasing mutex 'foo' that was not held}}
@@ -3311,7 +3311,7 @@ void test1() {
3311
3311
foo.a = 0 ;
3312
3312
foo.unlock1 ();
3313
3313
3314
- foo.lock1 ();
3314
+ foo.lock1 (); // expected-note{{mutex acquired here}}
3315
3315
foo.lock1 (); // expected-warning {{acquiring mutex 'foo.mu1_' that is already held}}
3316
3316
foo.a = 0 ;
3317
3317
foo.unlock1 ();
@@ -3325,7 +3325,7 @@ int test2() {
3325
3325
int d1 = foo.a ;
3326
3326
foo.unlock1 ();
3327
3327
3328
- foo.slock1 ();
3328
+ foo.slock1 (); // expected-note{{mutex acquired here}}
3329
3329
foo.slock1 (); // expected-warning {{acquiring mutex 'foo.mu1_' that is already held}}
3330
3330
int d2 = foo.a ;
3331
3331
foo.unlock1 ();
@@ -3342,7 +3342,7 @@ void test3() {
3342
3342
foo.c = 0 ;
3343
3343
foo.unlock3 ();
3344
3344
3345
- foo.lock3 ();
3345
+ foo.lock3 (); // expected-note 3 {{mutex acquired here}}
3346
3346
foo.lock3 (); // \
3347
3347
// expected-warning {{acquiring mutex 'foo.mu1_' that is already held}} \
3348
3348
// expected-warning {{acquiring mutex 'foo.mu2_' that is already held}} \
@@ -3366,7 +3366,7 @@ void testlots() {
3366
3366
foo.c = 0 ;
3367
3367
foo.unlocklots ();
3368
3368
3369
- foo.locklots ();
3369
+ foo.locklots (); // expected-note 3 {{mutex acquired here}}
3370
3370
foo.locklots (); // \
3371
3371
// expected-warning {{acquiring mutex 'foo.mu1_' that is already held}} \
3372
3372
// expected-warning {{acquiring mutex 'foo.mu2_' that is already held}} \
@@ -3524,7 +3524,7 @@ void test() {
3524
3524
LockAllGraphs ();
3525
3525
g2.mu_ .Unlock ();
3526
3526
3527
- LockAllGraphs ();
3527
+ LockAllGraphs (); // expected-note{{mutex acquired here}}
3528
3528
g1.mu_ .Lock (); // expected-warning {{acquiring mutex 'g1.mu_' that is already held}}
3529
3529
g1.mu_ .Unlock ();
3530
3530
}
0 commit comments