Home | History | Annotate | Download | only in SemaCXX

Lines Matching refs:mu_

972   void func1(int y) LOCKS_EXCLUDED(mu_);
973 template <typename T> void func2(T x) LOCKS_EXCLUDED(mu_);
975 Mutex mu_;
991 Mutex *mu_;
997 int GetA() EXCLUSIVE_LOCKS_REQUIRED(foo_->mu_) { return a_; }
998 int a_ GUARDED_BY(foo_->mu_);
1006 fb->foo_->mu_->Lock();
1008 fb->foo_->mu_->Unlock();
1124 Mutex mu_;
1131 mu_.Lock();
1133 mu_.Unlock();
1137 T count_ GUARDED_BY(mu_);
1139 Mutex mu_;
1193 virtual void func1() EXCLUSIVE_LOCKS_REQUIRED(mu_);
1194 virtual void func2() LOCKS_EXCLUDED(mu_);
1195 Mutex mu_;
1200 virtual void func1() EXCLUSIVE_LOCKS_REQUIRED(mu_);
1201 virtual void func2() LOCKS_EXCLUDED(mu_);
1208 b->mu_.Lock();
1210 b->mu_.Unlock();
1213 c->mu_.Lock();
1215 c->mu_.Unlock();
1233 void bar() LOCKS_EXCLUDED(mu_, mu1);
1234 int foo() SHARED_LOCKS_REQUIRED(mu_) EXCLUSIVE_LOCKS_REQUIRED(mu2);
1237 int a_ GUARDED_BY(mu_);
1239 Mutex mu_ ACQUIRED_AFTER(mu1);
1253 mu_.Lock();
1256 mu_.Unlock();
1267 f1.mu_.Lock();
1268 f1.bar(); // expected-warning {{cannot call function 'bar' while mutex 'f1.mu_' is held}}
1272 f1.mu_.Unlock();
1273 f2->mu_.Lock();
1274 f2->bar(); // expected-warning {{cannot call function 'bar' while mutex 'f2->mu_' is held}}
1275 f2->mu_.Unlock();
1464 virtual void func1() EXCLUSIVE_LOCKS_REQUIRED(mu_);
1465 virtual void func2() LOCKS_EXCLUDED(mu_);
1466 Mutex mu_;
1471 virtual void func1() EXCLUSIVE_LOCKS_REQUIRED(mu_);
1472 virtual void func2() LOCKS_EXCLUDED(mu_);
1479 b->func1(); // expected-warning {{calling function 'func1' requires holding mutex 'b->mu_' exclusively}}
1480 b->mu_.Lock();
1481 b->func2(); // expected-warning {{cannot call function 'func2' while mutex 'b->mu_' is held}}
1482 b->mu_.Unlock();
1484 c->func1(); // expected-warning {{calling function 'func1' requires holding mutex 'c->mu_' exclusively}}
1485 c->mu_.Lock();
1486 c->func2(); // expected-warning {{cannot call function 'func2' while mutex 'c->mu_' is held}}
1487 c->mu_.Unlock();
1688 Mutex mu_;
1689 int a GUARDED_BY(mu_);
1694 void foo() EXCLUSIVE_LOCKS_REQUIRED(fooObj.mu_);
1697 foo(); // expected-warning {{calling function 'foo' requires holding mutex 'fooObj.mu_' exclusively}}
1698 fooObj.mu_.Lock();
1700 fooObj.mu_.Unlock();
1839 Mutex mu_;
1840 int a GUARDED_BY(mu_);
1845 int a GUARDED_BY(mu_);
1846 Mutex mu_;
1854 void barND(Foo1 *foo, T *fooT) EXCLUSIVE_LOCKS_REQUIRED(foo->mu_) {
1860 void barD(Foo1 *foo, T *fooT) EXCLUSIVE_LOCKS_REQUIRED(fooT->mu_) {
1873 void barND() EXCLUSIVE_LOCKS_REQUIRED(fooBase.mu_) {
1878 void barD() EXCLUSIVE_LOCKS_REQUIRED(fooBaseT.mu_) {
1884 void barTD(T2 *fooT) EXCLUSIVE_LOCKS_REQUIRED(fooBaseT.mu_, fooT->mu_) {
1893 Mutex mu_;
1895 T data GUARDED_BY(mu_);
1897 void fooEx() EXCLUSIVE_LOCKS_REQUIRED(mu_) {
1902 mu_.Lock();
1904 mu_.Unlock();
1914 f1.mu_.Lock();
1915 f2.mu_.Lock();
1916 bt.fooBase.mu_.Lock();
1917 bt.fooBaseT.mu_.Lock();
1925 f1.mu_.Unlock();
1927 // expected-warning {{calling function 'barTD' requires holding mutex 'f1.mu_' exclusively}} \
1928 // expected-note {{found near match 'bt.fooBase.mu_'}}
1930 bt.fooBase.mu_.Unlock();
1931 bt.fooBaseT.mu_.Unlock();
1932 f2.mu_.Unlock();
1936 // expected-warning {{writing variable 'data' requires holding mutex 'cell.mu_' exclusively}}
1938 cell.mu_.Lock();
1940 cell.mu_.Unlock();
1948 T data GUARDED_BY(mu_);
1951 void fooEx(CellDelayed<T> *other) EXCLUSIVE_LOCKS_REQUIRED(mu_, other->mu_) {
1956 void fooExT(CellDelayed<T2> *otherT) EXCLUSIVE_LOCKS_REQUIRED(mu_, otherT->mu_) {
1961 mu_.Lock();
1963 mu_.Unlock();
1966 Mutex mu_;
1974 celld.mu_.Lock();
1975 celld2.mu_.Lock();
1980 celld2.mu_.Unlock();
1981 celld.mu_.Unlock();
1991 Mutex mu_;
1992 int a GUARDED_BY(mu_);
1994 virtual void foo1(Foo *f_declared) EXCLUSIVE_LOCKS_REQUIRED(f_declared->mu_);
1997 // EXCLUSIVE_LOCKS_REQUIRED should be applied, and rewritten to f_defined->mu_
2005 // expected-warning {{calling function 'foo1' requires holding mutex 'myfoo.mu_' exclusively}}
2006 myfoo.mu_.Lock();
2008 myfoo.mu_.Unlock();
2056 void fooT2(const T& dummy2) EXCLUSIVE_LOCKS_REQUIRED(mu_);
2058 Mutex mu_;
2059 int a GUARDED_BY(mu_);
2067 Mutex mu_;
2068 T a GUARDED_BY(mu_);
2076 void Foo::foo2() EXCLUSIVE_LOCKS_REQUIRED(mu_) {
2080 void Foo::foo3(Foo *other) EXCLUSIVE_LOCKS_REQUIRED(other->mu_) {
2085 void Foo::fooT1(const T& dummy1) EXCLUSIVE_LOCKS_REQUIRED(mu_) {
2096 void fooF1(Foo *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_) {
2101 void fooF2(Foo *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_) {
2105 void fooF3(Foo *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_);
2111 void FooT<T>::foo() EXCLUSIVE_LOCKS_REQUIRED(mu_) {
2120 // expected-warning {{calling function 'foo2' requires holding mutex 'myFoo.mu_' exclusively}}
2122 // expected-warning {{calling function 'foo3' requires holding mutex 'myFoo.mu_' exclusively}}
2124 // expected-warning {{calling function 'fooT1' requires holding mutex 'myFoo.mu_' exclusively}}
2127 // expected-warning {{calling function 'fooT2' requires holding mutex 'myFoo.mu_' exclusively}}
2130 // expected-warning {{calling function 'fooF1' requires holding mutex 'myFoo.mu_' exclusively}}
2132 // expected-warning {{calling function 'fooF2' requires holding mutex 'myFoo.mu_' exclusively}}
2134 mu_' exclusively}}
2136 myFoo.mu_.Lock();
2146 myFoo.mu_.Unlock();
2150 // expected-warning {{calling function 'foo' requires holding mutex 'myFooT.mu_' exclusively}}
2185 Mutex mu_;
2189 void lock() EXCLUSIVE_LOCK_FUNCTION() { mu_.Lock(); }
2190 void unlock() UNLOCK_FUNCTION() { mu_.Unlock(); }
2221 Mutex mu_;
2224 MutexLock lock(&mu_);
2238 int GUARDED_BY(mu_) a;
2239 int GUARDED_BY(mu_) b, c;
2243 // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
2245 // expected-warning {{writing variable 'b' requires holding mutex 'mu_' exclusively}}
2247 // expected-warning {{writing variable 'c' requires holding mutex 'mu_' exclusively}}
2251 Mutex mu_;
2274 Mutex mu_;
2275 int a GUARDED_BY(mu_);
2300 bar.getFoo().mu_.Lock();
2302 bar.getFoo().mu_.Unlock();
2304 (bar.getFoo().mu_).Lock(); // test parenthesis
2306 (bar.getFoo().mu_).Unlock();
2308 bar.getFoo2(a).mu_.Lock();
2310 bar.getFoo2(a).mu_.Unlock();
2312 bar.getFoo3(a, b).mu_.Lock();
2314 bar.getFoo3(a, b).mu_.Unlock();
2316 getBarFoo(bar, a).mu_.Lock();
2318 getBarFoo(bar, a).mu_.Unlock();
2320 bar.getFoo2(10).mu_.Lock();
2322 bar.getFoo2(10).mu_.Unlock();
2324 bar.getFoo2(a + 1).mu_.Lock();
2326 bar.getFoo2(a + 1).mu_.Unlock();
2328 (a > 0 ? fooArray[1] : fooArray[b]).mu_.Lock();
2330 (a > 0 ? fooArray[1] : fooArray[b]).mu_.Unlock();
2341 bar.getFoo().mu_.Lock();
2343 // expected-warning {{writing variable 'a' requires holding mutex 'bar.getFooey().mu_' exclusively}} \
2344 // expected-note {{found near match 'bar.getFoo().mu_'}}
2345 bar.getFoo().mu_.Unlock();
2347 bar.getFoo2(a).mu_.Lock();
2349 // expected-warning {{writing variable 'a' requires holding mutex 'bar.getFoo2(b).mu_' exclusively}} \
2350 // expected-note {{found near match 'bar.getFoo2(a).mu_'}}
2351 bar.getFoo2(a).mu_.Unlock();
2353 bar.getFoo3(a, b).mu_.Lock();
2355 // expected-warning {{writing variable 'a' requires holding mutex 'bar.getFoo3(a, c).mu_' exclusively}} \
2356 // expected-note {{found near match 'bar.getFoo3(a, b).mu_'}}
2357 bar.getFoo3(a, b).mu_.Unlock();
2359 getBarFoo(bar, a).mu_.Lock();
2361 // expected-warning {{writing variable 'a' requires holding mutex 'getBarFoo(bar, b).mu_' exclusively}} \
2362 // expected-note {{found near match 'getBarFoo(bar, a).mu_'}}
2363 getBarFoo(bar, a).mu_.Unlock();
2365 (a > 0 ? fooArray[1] : fooArray[b]).mu_.Lock();
2367 // expected-warning {{writing variable 'a' requires holding mutex '((0 < a) ? fooArray[b] : fooArray[c]).mu_' exclusively}} \
2368 // expected-note {{found near match '((0 < a) ? fooArray[1] : fooArray[b]).mu_'}}
2369 (a > 0 ? fooArray[1] : fooArray[b]).mu_.Unlock();
2400 int a GUARDED_BY(mu_);
2401 void foo() EXCLUSIVE_LOCKS_REQUIRED(mu_);
2402 void foo2(Foo* f) EXCLUSIVE_LOCKS_REQUIRED(mu_, f->mu_);
2404 static void sfoo(Foo* f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_);
2406 Mutex* getMu() LOCK_RETURNED(mu_);
2408 Mutex mu_;
2410 static Mutex* getMu(Foo* f) LOCK_RETURNED(f->mu_);
2416 f1->a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'f1->mu_' exclusively}}
2417 f1->foo(); // expected-warning {{calling function 'foo' requires holding mutex 'f1->mu_' exclusively}}
2419 f1->foo2(f2); // expected-warning {{calling function 'foo2' requires holding mutex 'f1->mu_' exclusively}} \
2420 // expected-warning {{calling function 'foo2' requires holding mutex 'f2->mu_' exclusively}}
2421 Foo::sfoo(f1); // expected-warning {{calling function 'sfoo' requires holding mutex 'f1->mu_' exclusively}}
2428 // expected-warning {{calling function 'foo2' requires holding mutex 'f2->mu_' exclusively}} \
2429 // expected-note {{found near match 'f1->mu_'}}
2458 b1->b = 0; // expected-warning {{writing variable 'b' requires holding mutex 'b1->mu_' exclusively}}
2459 b1->bar(); // expected-warning {{calling function 'bar' requires holding mutex 'b1->mu_' exclusively}}
2460 b1->bar2(b2); // expected-warning {{calling function 'bar2' requires holding mutex 'b1->mu_' exclusively}} \
2461 // expected-warning {{calling function 'bar2' requires holding mutex 'b2->mu_' exclusively}}
2462 Bar::sbar(b1); // expected-warning {{calling function 'sbar' requires holding mutex 'b1->mu_' exclusively}}
2463 Bar::sbar2(b1); // expected-warning {{calling function 'sbar2' requires holding mutex 'b1->mu_' exclusively}}
2470 // expected-warning {{calling function 'bar2' requires holding mutex 'b2->mu_' exclusively}} \
2471 // // expected-note {{found near match 'b1->mu_'}}
2488 b1->mu_.Lock();
2499 b1->mu_.Unlock();
2508 Mutex mu_;
2510 int a GUARDED_BY(mu_);
2521 ReleasableMutexLock rlock(&mu_);
2526 ReleasableMutexLock rlock(&mu_);
2533 ReleasableMutexLock rlock(&mu_);
2536 a = 1; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
2540 ReleasableMutexLock rlock(&mu_);
2542 rlock.Release(); // expected-warning {{releasing mutex 'mu_' that was not held}}
2546 ReleasableMutexLock rlock(&mu_);
2551 rlock.Release(); // expected-warning {{releasing mutex 'mu_' that was not held}}
2592 Mutex mu_;
2593 int a GUARDED_BY(mu_);
2595 void foo1() EXCLUSIVE_LOCKS_REQUIRED(mu_);
2596 int foo2() SHARED_LOCKS_REQUIRED(mu_);
2600 void Foo::foo1() EXCLUSIVE_LOCKS_REQUIRED(mu_) {
2604 int Foo::foo2() SHARED_LOCKS_REQUIRED(mu_) {
2646 Mutex mu_;
2647 int a GUARDED_BY(mu_);
2653 WTF_ScopedLockable wtf(&mu_);
2658 WTF_ScopedLockable wtf(&mu_); // expected-note {{mutex acquired here}}
2659 } // expected-warning {{mutex 'mu_' is still held at the end of function}}
2663 WTF_ScopedLockable wtf(&mu_);
2673 WTF_ScopedLockable wtf(&mu_);
2680 WTF_ScopedLockable wtf(&mu_); // expected-note {{mutex acquired here}}
2682 } // expected-warning {{mutex 'mu_' is not held on every path through here}}
2689 WTF_ScopedLockable wtf(&mu_); // expected-note {{mutex acquired here}}
2691 } // expected-warning {{mutex 'mu_' is not held on every path through here}}
2726 SmartPtr<Mutex> mu_;
2727 int a GUARDED_BY(mu_);
2728 int b GUARDED_BY(mu_.get());
2729 int c GUARDED_BY(*mu_);
2731 void Lock() EXCLUSIVE_LOCK_FUNCTION(mu_);
2732 void Unlock() UNLOCK_FUNCTION(mu_);
2746 a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
2747 b = 0; // expected-warning {{writing variable 'b' requires holding mutex 'mu_' exclusively}}
2748 c = 0; // expected-warning {{writing variable 'c' requires holding mutex 'mu_' exclusively}}
2752 mu_->Lock();
2756 mu_->Unlock();
2760 (*mu_).Lock();
2764 (*mu_).Unlock();
2769 mu_.get()->Lock();
2773 mu_.get()->Unlock();
2778 MutexLock lock(mu_.get());
2786 MutexLock lock(&(*mu_));
2805 mu_->Unlock();
2808 mu_->Lock();
2812 mu_.get()->Lock();
2813 mu_->Unlock();
2816 mu_->Lock();
2817 mu_.get()->Unlock();
2820 mu_.get()->Lock();
2821 (*mu_).Unlock();
2824 (*mu_).Lock();
2825 mu_->Unlock();
2831 mu_->Lock();
2832 mu_.get()->Lock(); // expected-warning {{acquiring mutex 'mu_' that is already held}}
2833 (*mu_).Lock(); // expected-warning {{acquiring mutex 'mu_' that is already held}}
2834 mu_.get()->Unlock();
2835 Unlock(); // expected-warning {{releasing mutex 'mu_' that was not held}}
2850 foo->a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'foo->mu_' exclusively}}
2851 (*foo).b = 0; // expected-warning {{writing variable 'b' requires holding mutex 'foo->mu_' exclusively}}
2852 foo.get()->c = 0; // expected-warning {{writing variable 'c' requires holding mutex 'foo->mu_' exclusively}}
2857 foo->mu_->Lock();
2861 foo->mu_->Unlock();
2866 (*foo).mu_->Lock();
2870 foo.get()->mu_->Unlock();
2875 MutexLock lock(foo->mu_.get());
3055 Mutex mu_;
3056 int a GUARDED_BY(mu_);
3059 int tryLockMutexI() EXCLUSIVE_TRYLOCK_FUNCTION(1, mu_);
3060 Mutex* tryLockMutexP() EXCLUSIVE_TRYLOCK_FUNCTION(1, mu_);
3061 void unlock() UNLOCK_FUNCTION(mu_);
3070 a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
3092 a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
3099 a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
3110 if (mu_.TryLock() == false) {
3111 a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
3117 if (mu_.TryLock() == true) {
3122 a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
3127 a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
3142 Mutex mu_;
3145 void LockAllGraphs() EXCLUSIVE_LOCK_FUNCTION(&Graph::mu_);
3146 void UnlockAllGraphs() UNLOCK_FUNCTION(&Graph::mu_);
3150 int a GUARDED_BY(&Graph::mu_);
3152 void foo() EXCLUSIVE_LOCKS_REQUIRED(&Graph::mu_) {
3155 void foo2() LOCKS_EXCLUDED(&Graph::mu_);
3163 n1.a = 0; // expected-warning {{writing variable 'a' requires holding mutex '&ExistentialPatternMatching::Graph::mu_' exclusively}}
3164 n1.foo(); // expected-warning {{calling function 'foo' requires holding mutex '&ExistentialPatternMatching::Graph::mu_' exclusively}}
3167 g1.mu_.Lock();
3170 n1.foo2(); // expected-warning {{cannot call function 'foo2' while mutex '&ExistentialPatternMatching::Graph::mu_' is held}}
3171 g1.mu_.Unlock();
3173 g2.mu_.Lock();
3176 n1.foo2(); // expected-warning {{cannot call function 'foo2' while mutex '&ExistentialPatternMatching::Graph::mu_' is held}}
3177 g2.mu_.Unlock();
3182 n1.foo2(); // expected-warning {{cannot call function 'foo2' while mutex '&ExistentialPatternMatching::Graph::mu_' is held}}
3186 g1.mu_.Unlock();
3189 g2.mu_.Unlock();
3192 g1.mu_.Lock(); // expected-warning {{acquiring mutex 'g1.mu_' that is already held}}
3193 g1.mu_.Unlock();
3203 Mutex mu_;
3273 Mutex mu_;
3274 int a GUARDED_BY(mu_);
3278 EXCLUSIVE_TRYLOCK_FUNCTION(true, &Foo::mu_);
3284 lt->mu_.Unlock();
3293 Mutex mu_;
3296 int a GUARDED_BY(mu_);
3297 void r_foo() SHARED_LOCKS_REQUIRED(mu_);
3298 void w_foo() EXCLUSIVE_LOCKS_REQUIRED(mu_);
3320 // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
3329 mu_.Lock();
3334 mu_.Lock();
3338 mu_.Unlock();
3345 mu_.Lock();
3346 mu_.Unlock();
3349 mu_.Lock();
3352 mu_.Unlock();
3354 mu_.Lock();
3356 mu_.Unlock();
3391 Mutex mu_;
3405 void unlockFoo() UNLOCK_FUNCTION(&Foo::mu_);
3413 foo->mu_.Lock();
3419 foo->mu_.Unlock();
3430 static Mutex mu_;
3432 Foo() EXCLUSIVE_LOCKS_REQUIRED(mu_) { }
3433 ~Foo() EXCLUSIVE_LOCKS_REQUIRED(mu_) { }
3435 int operator[](int i) EXCLUSIVE_LOCKS_REQUIRED(mu_) { return 0; }
3440 static Mutex mu_;
3442 Bar() LOCKS_EXCLUDED(mu_) { }
3443 ~Bar() LOCKS_EXCLUDED(mu_) { }
3445 int operator[](int i) LOCKS_EXCLUDED(mu_) { return 0; }
3450 Foo f; // expected-warning {{calling function 'Foo' requires holding mutex 'mu_' exclusively}}
3451 int a = f[0]; // expected-warning {{calling function 'operator[]' requires holding mutex 'mu_' exclusively}}
3452 } // expected-warning {{calling function '~Foo' requires holding mutex 'mu_' exclusively}}
3456 Bar::mu_.Lock();
3458 Bar b; // expected-warning {{cannot call function 'Bar' while mutex 'mu_' is held}}
3459 int a = b[0]; // expected-warning {{cannot call function 'operator[]' while mutex 'mu_' is held}}
3460 } // expected-warning {{cannot call function '~Bar' while mutex 'mu_' is held}}
3461 Bar::mu_.Unlock();
3542 Mutex* mu_;
3548 void elr(Cell<T>* c) __attribute__((exclusive_locks_required(c->mu_)));
3559 // expected-warning {{calling function 'elr' requires holding mutex 'cell.mu_' exclusively}}
3564 void globalELR(Cell<T>* c) __attribute__((exclusive_locks_required(c->mu_)));
3572 // expected-warning {{calling function 'globalELR' requires holding mutex 'cell.mu_' exclusively}}
3577 void globalELR2(Cell<T>* c) __attribute__((exclusive_locks_required(c->mu_)));
3593 // expected-warning {{calling function 'globalELR2' requires holding mutex 'cell.mu_' exclusively}}
3600 void elr(Cell<T>* c) __attribute__((exclusive_locks_required(c->mu_)));
3610 // expected-warning {{calling function 'elr' requires holding mutex 'cell.mu_' exclusively}}
3620 SelfLock() EXCLUSIVE_LOCK_FUNCTION(mu_);
3621 ~SelfLock() UNLOCK_FUNCTION(mu_);
3623 void foo() EXCLUSIVE_LOCKS_REQUIRED(mu_);
3625 Mutex mu_;
3798 // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3800 // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3803 // expected-warning {{reading variable 'datap1_' requires holding mutex 'mu_'}}
3805 // expected-warning {{reading variable 'datap1_' requires holding mutex 'mu_'}}
3808 // expected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}}
3810 // expected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}}
3813 // expected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}}
3815 // expected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}}
3817 mu_.Lock();
3821 mu_.Unlock();
3823 mu_.ReaderLock();
3828 mu_.Unlock();
3833 data_ = Data(1); // expected-warning {{writing variable 'data_' requires holding mutex 'mu_' exclusively}}
3834 *datap1_ = data_; // expected-warning {{reading variable 'datap1_' requires holding mutex 'mu_'}} \
3835 // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3836 *datap2_ = data_; // expected-warning {{writing the value pointed to by 'datap2_' requires holding mutex 'mu_' exclusively}} \
3837 // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3838 data_ = *datap1_; // expected-warning {{writing variable 'data_' requires holding mutex 'mu_' exclusively}} \
3839 // expected-warning {{reading variable 'datap1_' requires holding mutex 'mu_'}}
3840 data_ = *datap2_; // expected-warning {{writing variable 'data_' requires holding mutex 'mu_' exclusively}} \
3841 // expected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}}
3843 data_[0] = 0; // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3844 (*datap2_)[0] = 0; // expected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}}
3846 data_(); // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3851 Data mydat(data_); // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3854 //showDataCell(data_); // xpected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3855 //showDataCell(*datap2_); // xpected-warning {{reading the value pointed to by 'datap2_' requires holding mutex 'mu_'}}
3857 int a = data_[0]; // expected-warning {{reading variable 'data_' requires holding mutex 'mu_'}}
3861 Mutex mu_;
3862 Data data_ GUARDED_BY(mu_);
3863 Data* datap1_ GUARDED_BY(mu_);
3864 Data* datap2_ PT_GUARDED_BY(mu_);
3896 Mutex mu_;
3897 Foo foo GUARDED_BY(mu_);
3898 Foo* foop PT_GUARDED_BY(mu_);
3901 foo.myMethod(); // expected-warning {{reading variable 'foo' requires holding mutex 'mu_'}}
3903 int fa = foo.a; // expected-warning {{reading variable 'foo' requires holding mutex 'mu_'}}
3904 foo.a = fa; // expected-warning {{writing variable 'foo' requires holding mutex 'mu_' exclusively}}
3906 fa = foop->a; // expected-warning {{reading the value pointed to by 'foop' requires holding mutex 'mu_'}}
3907 foop->a = fa; // expected-warning {{writing the value pointed to by 'foop' requires holding mutex 'mu_' exclusively}}
3909 fa = (*foop).a; // expected-warning {{reading the value pointed to by 'foop' requires holding mutex 'mu_'}}
3910 (*foop).a = fa; // expected-warning {{writing the value pointed to by 'foop' requires holding mutex 'mu_' exclusively}}
3912 foo.c = Cell(0); // expected-warning {{writing variable 'foo' requires holding mutex 'mu_'}} \
3914 foo.c.cellMethod(); // expected-warning {{reading variable 'foo' requires holding mutex 'mu_'}} \
3917 foop->c = Cell(0); // expected-warning {{writing the value pointed to by 'foop' requires holding mutex 'mu_'}} \
3919 foop->c.cellMethod(); // expected-warning {{reading the value pointed to by 'foop' requires holding mutex 'mu_'}} \
3922 (*foop).c = Cell(0); // expected-warning {{writing the value pointed to by 'foop' requires holding mutex 'mu_'}} \
3924 (*foop).c.cellMethod(); // expected-warning {{reading the value pointed to by 'foop' requires holding mutex 'mu_'}} \
3935 Mutex mu_;
3940 mu_.Lock();
3944 mu_.Unlock();
3970 void lock() EXCLUSIVE_LOCK_FUNCTION() { mu_.Lock(); }
3971 void readerLock() SHARED_LOCK_FUNCTION() { mu_.ReaderLock(); }
3972 void unlock() UNLOCK_FUNCTION() { mu_.Unlock(); }
3975 Mutex mu_;
3982 void lock() EXCLUSIVE_LOCK_FUNCTION(mu_) {
3983 mu_.Lock();
3986 void readerLock() SHARED_LOCK_FUNCTION(mu_) {
3987 mu_.ReaderLock();
3990 void unlock() UNLOCK_FUNCTION(mu_) {
3991 mu_.Unlock();
3995 void lockBad() EXCLUSIVE_LOCK_FUNCTION(mu_) { // expected-note {{mutex acquired here}}
3998 } // expected-warning {{expecting mutex 'mu_' to be held at the end of function}}
4000 void readerLockBad() SHARED_LOCK_FUNCTION(mu_) { // expected-note {{mutex acquired here}}
4003 } // expected-warning {{expecting mutex 'mu_' to be held at the end of function}}
4005 void unlockBad() UNLOCK_FUNCTION(mu_) { // expected-note {{mutex acquired here}}
4008 } // expected-warning {{mutex 'mu_' is still held at the end of function}}
4011 void lockBad2() EXCLUSIVE_LOCK_FUNCTION(mu_) { // expected-note {{mutex acquired here}}
4013 } // expected-warning {{expecting mutex 'mu_' to be held at the end of function}} \
4017 void readerLockBad2() SHARED_LOCK_FUNCTION(mu_) { // expected-note {{mutex acquired here}}
4019 } // expected-warning {{expecting mutex 'mu_' to be held at the end of function}} \
4023 void unlockBad2() UNLOCK_FUNCTION(mu_) { // expected-note {{mutex acquired here}}
4025 } // expected-warning {{mutex 'mu_' is still held at the end of function}}
4028 Mutex mu_;
4040 int a GUARDED_BY(mu_);
4041 Mutex mu_;
4044 mu_.AssertHeld();
4050 mu_.AssertReaderHeld();
4052 a = 0; // expected-warning {{writing variable 'a' requires holding mutex 'mu_' exclusively}}
4057 mu_.AssertHeld();
4060 mu_.AssertHeld();
4066 void test4() EXCLUSIVE_LOCKS_REQUIRED(mu_) {
4067 mu_.AssertHeld();
4072 void test5() UNLOCK_FUNCTION(mu_) {
4073 mu_.AssertHeld();
4074 mu_.Unlock();
4078 mu_.AssertHeld();
4079 mu_.Unlock();
4084 mu_.AssertHeld();
4087 mu_.Lock();
4091 mu_.Unlock();
4096 mu_.Lock();
4099 mu_.AssertHeld();
4103 mu_.Unlock();
4108 mu_.AssertHeld();
4111 mu_.Lock(); // expected-note {{mutex acquired here}}
4113 } // expected-warning {{mutex 'mu_' is still held at the end of function}}
4117 mu_.Lock(); // expected-note {{mutex acquired here}}
4120 mu_.AssertHeld();
4122 } // expected-warning {{mutex 'mu_' is still held at the end of function}}
4124 void assertMu() ASSERT_EXCLUSIVE_LOCK(mu_);
4413 Mutex mu_;
4415 void LockedFunction() EXCLUSIVE_LOCKS_REQUIRED(mu_);
4418 auto func1 = [this]() EXCLUSIVE_LOCKS_REQUIRED(mu_) {
4426 auto func3 = [this]() EXCLUSIVE_LOCK_FUNCTION(mu_) {
4427 mu_.Lock();
4430 func1(); // expected-warning {{calling function 'operator()' requires holding mutex 'mu_' exclusively}}
4433 mu_.Unlock();