Lines Matching refs:mu
27 static void AssertDepth(Mutex& mu, uint32_t expected_depth) { in AssertDepth()
28 ASSERT_EQ(expected_depth, mu.GetDepth()); in AssertDepth()
32 mu.AssertNotHeld(Thread::Current()); in AssertDepth()
34 mu.AssertHeld(Thread::Current()); in AssertDepth()
40 Mutex mu("test mutex"); in TEST_F() local
41 MutexTester::AssertDepth(mu, 0U); in TEST_F()
42 mu.Lock(Thread::Current()); in TEST_F()
43 MutexTester::AssertDepth(mu, 1U); in TEST_F()
44 mu.Unlock(Thread::Current()); in TEST_F()
45 MutexTester::AssertDepth(mu, 0U); in TEST_F()
50 Mutex mu("test mutex"); in TryLockUnlockTest() local
51 MutexTester::AssertDepth(mu, 0U); in TryLockUnlockTest()
52 ASSERT_TRUE(mu.TryLock(Thread::Current())); in TryLockUnlockTest()
53 MutexTester::AssertDepth(mu, 1U); in TryLockUnlockTest()
54 mu.Unlock(Thread::Current()); in TryLockUnlockTest()
55 MutexTester::AssertDepth(mu, 0U); in TryLockUnlockTest()
64 Mutex mu("test mutex", kDefaultMutexLevel, true); in RecursiveLockUnlockTest() local
65 MutexTester::AssertDepth(mu, 0U); in RecursiveLockUnlockTest()
66 mu.Lock(Thread::Current()); in RecursiveLockUnlockTest()
67 MutexTester::AssertDepth(mu, 1U); in RecursiveLockUnlockTest()
68 mu.Lock(Thread::Current()); in RecursiveLockUnlockTest()
69 MutexTester::AssertDepth(mu, 2U); in RecursiveLockUnlockTest()
70 mu.Unlock(Thread::Current()); in RecursiveLockUnlockTest()
71 MutexTester::AssertDepth(mu, 1U); in RecursiveLockUnlockTest()
72 mu.Unlock(Thread::Current()); in RecursiveLockUnlockTest()
73 MutexTester::AssertDepth(mu, 0U); in RecursiveLockUnlockTest()
82 Mutex mu("test mutex", kDefaultMutexLevel, true); in RecursiveTryLockUnlockTest() local
83 MutexTester::AssertDepth(mu, 0U); in RecursiveTryLockUnlockTest()
84 ASSERT_TRUE(mu.TryLock(Thread::Current())); in RecursiveTryLockUnlockTest()
85 MutexTester::AssertDepth(mu, 1U); in RecursiveTryLockUnlockTest()
86 ASSERT_TRUE(mu.TryLock(Thread::Current())); in RecursiveTryLockUnlockTest()
87 MutexTester::AssertDepth(mu, 2U); in RecursiveTryLockUnlockTest()
88 mu.Unlock(Thread::Current()); in RecursiveTryLockUnlockTest()
89 MutexTester::AssertDepth(mu, 1U); in RecursiveTryLockUnlockTest()
90 mu.Unlock(Thread::Current()); in RecursiveTryLockUnlockTest()
91 MutexTester::AssertDepth(mu, 0U); in RecursiveTryLockUnlockTest()
101 : mu("test mutex", kDefaultMutexLevel, true), cv("test condition variable", mu) { in RecursiveLockWait()
104 Mutex mu; member
110 state->mu.Lock(Thread::Current()); in RecursiveLockWaitCallback()
112 state->mu.Unlock(Thread::Current()); in RecursiveLockWaitCallback()
119 state.mu.Lock(Thread::Current()); in RecursiveLockWaitTest()
120 state.mu.Lock(Thread::Current()); in RecursiveLockWaitTest()
128 state.mu.Unlock(Thread::Current()); in RecursiveLockWaitTest()
129 state.mu.Unlock(Thread::Current()); in RecursiveLockWaitTest()
140 ReaderWriterMutex mu("test rwmutex"); in TEST_F() local
141 mu.AssertNotHeld(Thread::Current()); in TEST_F()
142 mu.AssertNotExclusiveHeld(Thread::Current()); in TEST_F()
143 mu.SharedLock(Thread::Current()); in TEST_F()
144 mu.AssertSharedHeld(Thread::Current()); in TEST_F()
145 mu.AssertNotExclusiveHeld(Thread::Current()); in TEST_F()
146 mu.SharedUnlock(Thread::Current()); in TEST_F()
147 mu.AssertNotHeld(Thread::Current()); in TEST_F()
151 ReaderWriterMutex mu("test rwmutex"); in TEST_F() local
152 mu.AssertNotHeld(Thread::Current()); in TEST_F()
153 mu.ExclusiveLock(Thread::Current()); in TEST_F()
154 mu.AssertSharedHeld(Thread::Current()); in TEST_F()
155 mu.AssertExclusiveHeld(Thread::Current()); in TEST_F()
156 mu.ExclusiveUnlock(Thread::Current()); in TEST_F()
157 mu.AssertNotHeld(Thread::Current()); in TEST_F()
162 ReaderWriterMutex mu("test rwmutex"); in SharedTryLockUnlockTest() local
163 mu.AssertNotHeld(Thread::Current()); in SharedTryLockUnlockTest()
164 ASSERT_TRUE(mu.SharedTryLock(Thread::Current())); in SharedTryLockUnlockTest()
165 mu.AssertSharedHeld(Thread::Current()); in SharedTryLockUnlockTest()
166 mu.SharedUnlock(Thread::Current()); in SharedTryLockUnlockTest()
167 mu.AssertNotHeld(Thread::Current()); in SharedTryLockUnlockTest()