Lines Matching defs:mu1

56   DoubleMutexLock(Mutex *mu1, Mutex *mu2) EXCLUSIVE_LOCK_FUNCTION(mu1, mu2);
996 Mutex mu1;
997 Mutex mu2 ACQUIRED_AFTER(mu1);
1001 int method1(int i) SHARED_LOCKS_REQUIRED(mu2) EXCLUSIVE_LOCKS_REQUIRED(mu1);
1009 int foo(int i) EXCLUSIVE_LOCKS_REQUIRED(mu2) SHARED_LOCKS_REQUIRED(mu1);
1014 static int bar(int i) EXCLUSIVE_LOCKS_REQUIRED(mu1);
1022 mu1.Lock();
1028 mu1.Unlock();
1159 int method1(int i) SHARED_LOCKS_REQUIRED(mu1, mu, mu2);
1160 int data GUARDED_BY(mu1);
1161 Mutex *mu1;
1175 a.mu1->Lock();
1179 a.mu1->Unlock();
1291 Mutex mu1;
1294 int g GUARDED_BY(mu1);
1299 void bar() LOCKS_EXCLUDED(mu_, mu1);
1305 Mutex mu_ ACQUIRED_AFTER(mu1);
1324 mu1.Lock();
1326 mu1.Unlock();
1499 Mutex mu1, mu2, mu3;
1500 int x GUARDED_BY(mu1) GUARDED_BY(mu2);
1503 void f2() LOCKS_EXCLUDED(mu1) LOCKS_EXCLUDED(mu2) LOCKS_EXCLUDED(mu3) {
1510 void f1() EXCLUSIVE_LOCKS_REQUIRED(mu2) EXCLUSIVE_LOCKS_REQUIRED(mu1) {
1512 f2(); // expected-warning {{cannot call function 'f2' while mutex 'mu1' is held}} \
1522 // expected-warning {{calling function 'f1' requires holding mutex 'foo->mu1' exclusively}}
1566 int method1(int i) SHARED_LOCKS_REQUIRED(mu1, mu, mu2, mu3);
1567 int data GUARDED_BY(mu1);
1568 Mutex *mu1;
1579 a.method1(1); // expected-warning {{calling function 'method1' requires holding mutex 'a.mu1'}} \
1753 Mutex mu1;
1755 int a __attribute__((guarded_by(mu1)));
1763 MutexLock mulock(&mu1);
1769 const MutexLock mulock = MutexLock(&mu1);
1775 MutexLock{&mu1}, a = 5;
1780 lock2Bool(MutexLock{&mu1}) || x;
1781 MutexLock{&mu1}; // no-warn
1785 const MutexLock &mulock = MutexLock(&mu1);
1790 ReaderMutexLock mulock1(&mu1);
1802 MutexLock mulock_a(&mu1); // expected-note{{mutex acquired here}}
1803 MutexLock mulock_b(&mu1); // \
1804 // expected-warning {{acquiring mutex 'mu1' that is already held}}
1808 MutexLock mulock_a(&mu1); // expected-note{{mutex acquired here}}
1809 MutexLock{&mu1}; // \
1810 // expected-warning {{acquiring mutex 'mu1' that is already held}}
1814 MutexLock mulock1(&mu1), mulock2(&mu2);
1820 DoubleMutexLock mulock(&mu1, &mu2);
3181 MutexLockUnlock(Mutex *mu1, Mutex *mu2) EXCLUSIVE_UNLOCK_FUNCTION(mu1) EXCLUSIVE_LOCK_FUNCTION(mu2);
3218 Mutex mu1;
5369 Mutex mu1;
5371 int* a GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
5372 Cell* c GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
5373 int sa[10] GUARDED_BY(mu1);
5374 Cell sc[10] GUARDED_BY(mu1);
5379 mu1.Lock();
5387 mu1.Unlock();
5391 mu1.ReaderLock();
5407 mu1.Unlock();
5412 if (*a == 0) doSomething(); // expected-warning {{reading variable 'a' requires holding mutex 'mu1'}}
5413 *a = 0; // expected-warning {{reading variable 'a' requires holding mutex 'mu1'}}
5415 if (c->a == 0) doSomething(); // expected-warning {{reading variable 'c' requires holding mutex 'mu1'}}
5416 c->a = 0; // expected-warning {{reading variable 'c' requires holding mutex 'mu1'}}
5418 if ((*c).a == 0) doSomething(); // expected-warning {{reading variable 'c' requires holding mutex 'mu1'}}
5419 (*c).a = 0; // expected-warning {{reading variable 'c' requires holding mutex 'mu1'}}
5421 if (a[0] == 42) doSomething(); // expected-warning {{reading variable 'a' requires holding mutex 'mu1'}}
5422 a[0] = 57; // expected-warning {{reading variable 'a' requires holding mutex 'mu1'}}
5423 if (c[0].a == 42) doSomething(); // expected-warning {{reading variable 'c' requires holding mutex 'mu1'}}
5424 c[0].a = 57; // expected-warning {{reading variable 'c' requires holding mutex 'mu1'}}
5429 if (sa[0] == 42) doSomething(); // expected-warning {{reading variable 'sa' requires holding mutex 'mu1'}}
5430 sa[0] = 57; // expected-warning {{writing variable 'sa' requires holding mutex 'mu1' exclusively}}
5431 if (sc[0].a == 42) doSomething(); // expected-warning {{reading variable 'sc' requires holding mutex 'mu1'}}
5432 sc[0].a = 57; // expected-warning {{writing variable 'sc' requires holding mutex 'mu1' exclusively}}
5433 sc[0].*pa = 57; // expected-warning {{writing variable 'sc' requires holding mutex 'mu1' exclusively}}
5435 if (*sa == 42) doSomething(); // expected-warning {{reading variable 'sa' requires holding mutex 'mu1'}}
5436 *sa = 57; // expected-warning {{writing variable 'sa' requires holding mutex 'mu1' exclusively}}
5437 if ((*sc).a == 42) doSomething(); // expected-warning {{reading variable 'sc' requires holding mutex 'mu1'}}
5438 (*sc).a = 57; // expected-warning {{writing variable 'sc' requires holding mutex 'mu1' exclusively}}
5439 if (sc->a == 42) doSomething(); // expected-warning {{reading variable 'sc' requires holding mutex 'mu1'}}
5440 sc->a = 57; // expected-warning {{writing variable 'sc' requires holding mutex 'mu1' exclusively}}
5444 mu1.ReaderLock(); // OK -- correct use.
5455 mu1.Unlock();
5461 Mutex mu1;
5463 SmartPtr<int> sp GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
5464 SmartPtr<Cell> sq GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
5469 mu1.ReaderLock();
5482 mu1.Unlock();
5488 sp.get(); // expected-warning {{reading variable 'sp' requires holding mutex 'mu1'}}
5489 if (*sp == 0) doSomething(); // expected-warning {{reading variable 'sp' requires holding mutex 'mu1'}}
5490 *sp = 0; // expected-warning {{reading variable 'sp' requires holding mutex 'mu1'}}
5491 sq->a = 0; // expected-warning {{reading variable 'sq' requires holding mutex 'mu1'}}
5492 sq->*pa = 0; // expected-warning {{reading variable 'sq' requires holding mutex 'mu1'}}
5494 if (sp[0] == 0) doSomething(); // expected-warning {{reading variable 'sp' requires holding mutex 'mu1'}}
5495 sp[0] = 0; // expected-warning {{reading variable 'sp' requires holding mutex 'mu1'}}
5496 if (sq[0].a == 0) doSomething(); // expected-warning {{reading variable 'sq' requires holding mutex 'mu1'}}
5497 sq[0].a = 0; // expected-warning {{reading variable 'sq' requires holding mutex 'mu1'}}
5503 mu1.Lock();
5516 mu1.Unlock();
6108 Mutex mu1 ACQUIRED_BEFORE(mu2, mu3);
6113 mu1.Lock();
6119 mu1.Unlock();
6124 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu2'}}
6125 mu1.Unlock();
6131 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu3'}}
6132 mu1.Unlock();
6136 void test4() EXCLUSIVE_LOCKS_REQUIRED(mu1) {
6142 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu2'}}
6143 mu1.Unlock();
6147 mu1.AssertHeld();
6150 void test7() EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2, mu3) { }
6152 void test8() EXCLUSIVE_LOCKS_REQUIRED(mu3, mu2, mu1) { }
6157 Mutex mu1;
6158 Mutex mu2 ACQUIRED_AFTER(mu1);
6159 Mutex mu3 ACQUIRED_AFTER(mu1);
6162 mu1.Lock();
6168 mu1.Unlock();
6173 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu2'}}
6174 mu1.Unlock();
6180 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu3'}}
6181 mu1.Unlock();
6188 Mutex mu1 ACQUIRED_BEFORE(mu2);
6194 mu1.Lock();
6202 mu1.Unlock();
6215 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu4'}}
6217 mu1.Unlock();
6223 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu3'}}
6225 mu1.Unlock();
6233 Mutex mu1;
6234 Mutex mu2 ACQUIRED_AFTER(mu1);
6235 Mutex mu3 ACQUIRED_AFTER(mu1);
6244 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu8'}}
6245 mu1.Unlock();
6253 Mutex mu1 ACQUIRED_BEFORE(mu2, mu3);
6264 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu8'}}
6265 mu1.Unlock();
6272 Mutex mu1 ACQUIRED_AFTER(mu3); // expected-warning {{cycle in acquired_before/after dependencies, starting with 'mu1'}}
6273 Mutex mu2 ACQUIRED_AFTER(mu1); // expected-warning {{cycle in acquired_before/after dependencies, starting with 'mu2'}}
6287 mu1.Lock();
6288 mu1.Unlock();
6292 mu1.Lock();
6297 mu1.Unlock();
6401 Mutex mu1;
6402 Mutex mu2 ACQUIRED_AFTER(mu1);
6406 mu1.Lock(); // expected-warning {{mutex 'mu1' must be acquired before 'mu2'}}
6407 mu1.Unlock();
6600 Mutex mu1;
6602 SmartPtr_Derived<int> i GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
6605 i.get(); // expected-warning {{reading variable 'i' requires holding mutex 'mu1'}}
6606 *i = 2; // expected-warning {{reading variable 'i' requires holding mutex 'mu1'}} \
6612 mu1.Lock();
6617 mu1.Unlock();
6623 i.get(); // expected-warning {{reading variable 'i' requires holding mutex 'mu1'}}
6624 *i = 2; // expected-warning {{reading variable 'i' requires holding mutex 'mu1'}}
6630 mu1.Lock();
6637 mu1.Unlock();