File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -271,16 +271,13 @@ TEST(SpinLockWithThreads, DoesNotDeadlock) {
271271 }
272272 };
273273
274+ int num_threads = base_internal::NumCPUs () * 2 ;
274275 SpinLock stack_cooperative_spinlock;
275276 SpinLock stack_noncooperative_spinlock (base_internal::SCHEDULE_KERNEL_ONLY);
276- Helper::DeadlockTest (&stack_cooperative_spinlock,
277- base_internal::NumCPUs () * 2 );
278- Helper::DeadlockTest (&stack_noncooperative_spinlock,
279- base_internal::NumCPUs () * 2 );
280- Helper::DeadlockTest (&static_cooperative_spinlock,
281- base_internal::NumCPUs () * 2 );
282- Helper::DeadlockTest (&static_noncooperative_spinlock,
283- base_internal::NumCPUs () * 2 );
277+ Helper::DeadlockTest (&stack_cooperative_spinlock, num_threads);
278+ Helper::DeadlockTest (&stack_noncooperative_spinlock, num_threads);
279+ Helper::DeadlockTest (&static_cooperative_spinlock, num_threads);
280+ Helper::DeadlockTest (&static_noncooperative_spinlock, num_threads);
284281}
285282
286283TEST (SpinLockTest, IsCooperative) {
You can’t perform that action at this time.
0 commit comments