• Home
  • Raw
  • Download

Lines Matching full:lock

5 #include "base/synchronization/lock.h"
21 explicit BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {} in BasicLockTestThread() argument
47 Lock* lock_;
54 Lock lock; in TEST() local
55 BasicLockTestThread thread(&lock); in TEST()
62 lock.Acquire(); in TEST()
64 lock.Release(); in TEST()
67 lock.Acquire(); in TEST()
70 lock.Release(); in TEST()
73 if (lock.Try()) { in TEST()
76 lock.Release(); in TEST()
80 lock.Acquire(); in TEST()
83 lock.Release(); in TEST()
96 explicit TryLockTestThread(Lock* lock) : lock_(lock), got_lock_(false) {} in TryLockTestThread() argument
107 Lock* lock_;
114 Lock lock; in TEST() local
116 ASSERT_TRUE(lock.Try()); in TEST()
117 // We now have the lock.... in TEST()
119 // This thread will not be able to get the lock. in TEST()
121 TryLockTestThread thread(&lock); in TEST()
131 lock.Release(); in TEST()
135 TryLockTestThread thread(&lock); in TEST()
144 ASSERT_TRUE(lock.Try()); in TEST()
147 lock.Release(); in TEST()
154 Lock lock; in TEST() local
156 ASSERT_TRUE(lock.Try()); in TEST()
157 // We now have the lock.... in TEST()
159 // This thread will not be able to get the lock. in TEST()
161 TryLockTestThread thread(&lock); in TEST()
171 lock.Release(); in TEST()
175 TryLockTestThread thread(&lock); in TEST()
184 ASSERT_TRUE(lock.Try()); in TEST()
187 lock.Release(); in TEST()
195 MutexLockTestThread(Lock* lock, int* value) : lock_(lock), value_(value) {} in MutexLockTestThread() argument
198 static void DoStuff(Lock* lock, int* value) { in DoStuff() argument
200 lock->Acquire(); in DoStuff()
204 lock->Release(); in DoStuff()
211 Lock* lock_;
218 Lock lock; in TEST() local
221 MutexLockTestThread thread(&lock, &value); in TEST()
226 MutexLockTestThread::DoStuff(&lock, &value); in TEST()
234 Lock lock; in TEST() local
237 MutexLockTestThread thread1(&lock, &value); in TEST()
238 MutexLockTestThread thread2(&lock, &value); in TEST()
239 MutexLockTestThread thread3(&lock, &value); in TEST()
248 MutexLockTestThread::DoStuff(&lock, &value); in TEST()