Lines Matching refs:mu
32 static void AssertDepth(Mutex& mu, uint32_t expected_depth) { in AssertDepth()
33 ASSERT_EQ(expected_depth, mu.GetDepth()); in AssertDepth()
37 mu.AssertNotHeld(Thread::Current()); in AssertDepth()
39 mu.AssertHeld(Thread::Current()); in AssertDepth()
48 Mutex mu("test mutex"); in TEST_F() local
49 MutexTester::AssertDepth(mu, 0U); in TEST_F()
50 mu.Lock(Thread::Current()); in TEST_F()
51 MutexTester::AssertDepth(mu, 1U); in TEST_F()
52 mu.Unlock(Thread::Current()); in TEST_F()
53 MutexTester::AssertDepth(mu, 0U); in TEST_F()
58 Mutex mu("test mutex"); in TryLockUnlockTest() local
59 MutexTester::AssertDepth(mu, 0U); in TryLockUnlockTest()
60 ASSERT_TRUE(mu.TryLock(Thread::Current())); in TryLockUnlockTest()
61 MutexTester::AssertDepth(mu, 1U); in TryLockUnlockTest()
62 mu.Unlock(Thread::Current()); in TryLockUnlockTest()
63 MutexTester::AssertDepth(mu, 0U); in TryLockUnlockTest()
72 Mutex mu("test mutex", kDefaultMutexLevel, true); in RecursiveLockUnlockTest() local
73 MutexTester::AssertDepth(mu, 0U); in RecursiveLockUnlockTest()
74 mu.Lock(Thread::Current()); in RecursiveLockUnlockTest()
75 MutexTester::AssertDepth(mu, 1U); in RecursiveLockUnlockTest()
76 mu.Lock(Thread::Current()); in RecursiveLockUnlockTest()
77 MutexTester::AssertDepth(mu, 2U); in RecursiveLockUnlockTest()
78 mu.Unlock(Thread::Current()); in RecursiveLockUnlockTest()
79 MutexTester::AssertDepth(mu, 1U); in RecursiveLockUnlockTest()
80 mu.Unlock(Thread::Current()); in RecursiveLockUnlockTest()
81 MutexTester::AssertDepth(mu, 0U); in RecursiveLockUnlockTest()
90 Mutex mu("test mutex", kDefaultMutexLevel, true); in RecursiveTryLockUnlockTest() local
91 MutexTester::AssertDepth(mu, 0U); in RecursiveTryLockUnlockTest()
92 ASSERT_TRUE(mu.TryLock(Thread::Current())); in RecursiveTryLockUnlockTest()
93 MutexTester::AssertDepth(mu, 1U); in RecursiveTryLockUnlockTest()
94 ASSERT_TRUE(mu.TryLock(Thread::Current())); in RecursiveTryLockUnlockTest()
95 MutexTester::AssertDepth(mu, 2U); in RecursiveTryLockUnlockTest()
96 mu.Unlock(Thread::Current()); in RecursiveTryLockUnlockTest()
97 MutexTester::AssertDepth(mu, 1U); in RecursiveTryLockUnlockTest()
98 mu.Unlock(Thread::Current()); in RecursiveTryLockUnlockTest()
99 MutexTester::AssertDepth(mu, 0U); in RecursiveTryLockUnlockTest()
109 : mu("test mutex", kDefaultMutexLevel, true), cv("test condition variable", mu) { in RecursiveLockWait()
112 Mutex mu; member
118 state->mu.Lock(Thread::Current()); in RecursiveLockWaitCallback()
120 state->mu.Unlock(Thread::Current()); in RecursiveLockWaitCallback()
127 state.mu.Lock(Thread::Current()); in RecursiveLockWaitTest()
128 state.mu.Lock(Thread::Current()); in RecursiveLockWaitTest()
136 state.mu.Unlock(Thread::Current()); in RecursiveLockWaitTest()
137 state.mu.Unlock(Thread::Current()); in RecursiveLockWaitTest()
148 ReaderWriterMutex mu("test rwmutex"); in TEST_F() local
149 mu.AssertNotHeld(Thread::Current()); in TEST_F()
150 mu.AssertNotExclusiveHeld(Thread::Current()); in TEST_F()
151 mu.SharedLock(Thread::Current()); in TEST_F()
152 mu.AssertSharedHeld(Thread::Current()); in TEST_F()
153 mu.AssertNotExclusiveHeld(Thread::Current()); in TEST_F()
154 mu.SharedUnlock(Thread::Current()); in TEST_F()
155 mu.AssertNotHeld(Thread::Current()); in TEST_F()
159 ReaderWriterMutex mu("test rwmutex"); in TEST_F() local
160 mu.AssertNotHeld(Thread::Current()); in TEST_F()
161 mu.ExclusiveLock(Thread::Current()); in TEST_F()
162 mu.AssertSharedHeld(Thread::Current()); in TEST_F()
163 mu.AssertExclusiveHeld(Thread::Current()); in TEST_F()
164 mu.ExclusiveUnlock(Thread::Current()); in TEST_F()
165 mu.AssertNotHeld(Thread::Current()); in TEST_F()
170 ReaderWriterMutex mu("test rwmutex"); in SharedTryLockUnlockTest() local
171 mu.AssertNotHeld(Thread::Current()); in SharedTryLockUnlockTest()
172 ASSERT_TRUE(mu.SharedTryLock(Thread::Current())); in SharedTryLockUnlockTest()
173 mu.AssertSharedHeld(Thread::Current()); in SharedTryLockUnlockTest()
174 mu.SharedUnlock(Thread::Current()); in SharedTryLockUnlockTest()
175 mu.AssertNotHeld(Thread::Current()); in SharedTryLockUnlockTest()