Lines Matching refs:spinlock
82 static void TestFunction(int thread_salt, SpinLock* spinlock) { in TestFunction() argument
84 SpinLockHolder h(spinlock); in TestFunction()
93 static void ThreadedTest(SpinLock* spinlock) { in ThreadedTest() argument
96 threads.push_back(std::thread(TestFunction, i, spinlock)); in ThreadedTest()
102 SpinLockHolder h(spinlock); in ThreadedTest()
113 SpinLock spinlock(base_internal::SCHEDULE_KERNEL_ONLY); in TEST() local
114 spinlock.Lock(); in TEST()
116 spinlock.Unlock(); in TEST()
199 SpinLock spinlock; in TEST() local
200 ThreadedTest(&spinlock); in TEST()
204 SpinLock spinlock(base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL); in TEST() local
205 ThreadedTest(&spinlock); in TEST()
209 SpinLock spinlock(base_internal::SCHEDULE_KERNEL_ONLY); in TEST() local
210 ThreadedTest(&spinlock); in TEST()
223 static void NotifyThenLock(Notification* locked, SpinLock* spinlock, in TEST()
227 SpinLockHolder l(spinlock); in TEST()
230 static void LockThenWait(Notification* locked, SpinLock* spinlock, in TEST()
232 SpinLockHolder l(spinlock); in TEST()
237 static void DeadlockTest(SpinLock* spinlock, int num_spinners) { in TEST()
243 std::thread(Helper::LockThenWait, &locked, spinlock, &counter)); in TEST()
246 std::thread(Helper::NotifyThenLock, &locked, spinlock, &counter)); in TEST()