Lines Matching refs:lock

29   BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {}  in BasicLockTestThread()  argument
62 Lock lock; in BasicLockTest() local
63 BasicLockTestThread thread(&lock); in BasicLockTest()
70 lock.Acquire(); in BasicLockTest()
72 lock.Unlock(); in BasicLockTest()
75 lock.Acquire(); in BasicLockTest()
78 lock.Unlock(); in BasicLockTest()
81 if (lock.Try()) { in BasicLockTest()
84 lock.Unlock(); in BasicLockTest()
88 lock.Acquire(); in BasicLockTest()
91 lock.Unlock(); in BasicLockTest()
106 TryLockTestThread(Lock* lock) : lock_(lock), got_lock_(false) {} in TryLockTestThread() argument
124 Lock lock; in TryLockTest() local
126 EXPECT_TRUE(lock.Try()); in TryLockTest()
131 TryLockTestThread thread(&lock); in TryLockTest()
141 lock.Unlock(); in TryLockTest()
145 TryLockTestThread thread(&lock); in TryLockTest()
154 EXPECT_TRUE(lock.Try()); in TryLockTest()
157 lock.Unlock(); in TryLockTest()
165 MutexLockTestThread(Lock* lock, int* value) : lock_(lock), value_(value) {} in MutexLockTestThread() argument
168 static void DoStuff(Lock* lock, int* value) { in DoStuff() argument
170 lock->Acquire(); in DoStuff()
174 lock->Unlock(); in DoStuff()
190 Lock lock; in MutexTwoThreads() local
193 MutexLockTestThread thread(&lock, &value); in MutexTwoThreads()
198 MutexLockTestThread::DoStuff(&lock, &value); in MutexTwoThreads()
207 Lock lock; in MutexFourThreads() local
210 MutexLockTestThread thread1(&lock, &value); in MutexFourThreads()
211 MutexLockTestThread thread2(&lock, &value); in MutexFourThreads()
212 MutexLockTestThread thread3(&lock, &value); in MutexFourThreads()
221 MutexLockTestThread::DoStuff(&lock, &value); in MutexFourThreads()