Remove multi-poster support from Baton
[folly.git] / folly / synchronization / test / BatonTest.cpp
index 2e6f516..955f29b 100644 (file)
@@ -28,258 +28,92 @@ using folly::detail::EmulatedFutexAtomic;
 
 /// Basic test
 
-TEST(Baton, basic_single_poster_blocking) {
-  run_basic_test<std::atomic, true, true>();
-  run_basic_test<EmulatedFutexAtomic, true, true>();
-  run_basic_test<DeterministicAtomic, true, true>();
+TEST(Baton, basic_blocking) {
+  run_basic_test<std::atomic, true>();
+  run_basic_test<EmulatedFutexAtomic, true>();
+  run_basic_test<DeterministicAtomic, true>();
 }
 
-TEST(Baton, basic_single_poster_nonblocking) {
-  run_basic_test<std::atomic, true, false>();
-  run_basic_test<EmulatedFutexAtomic, true, false>();
-  run_basic_test<DeterministicAtomic, true, false>();
-}
-
-TEST(Baton, basic_multi_poster_blocking) {
-  run_basic_test<std::atomic, false, true>();
-}
-
-TEST(Baton, basic_multi_poster_nonblocking) {
-  run_basic_test<std::atomic, false, false>();
+TEST(Baton, basic_nonblocking) {
+  run_basic_test<std::atomic, false>();
+  run_basic_test<EmulatedFutexAtomic, false>();
+  run_basic_test<DeterministicAtomic, false>();
 }
 
 /// Ping pong tests
 
-TEST(Baton, pingpong_single_poster_blocking) {
-  DSched sched(DSched::uniform(0));
-
-  run_pingpong_test<DeterministicAtomic, true, true>(1000);
-}
-
-TEST(Baton, pingpong_single_poster_nonblocking) {
+TEST(Baton, pingpong_blocking) {
   DSched sched(DSched::uniform(0));
 
-  run_pingpong_test<DeterministicAtomic, true, false>(1000);
+  run_pingpong_test<DeterministicAtomic, true>(1000);
 }
 
-TEST(Baton, pingpong_multi_poster_blocking) {
+TEST(Baton, pingpong_nonblocking) {
   DSched sched(DSched::uniform(0));
 
-  run_pingpong_test<DeterministicAtomic, false, true>(1000);
-}
-
-TEST(Baton, pingpong_multi_poster_nonblocking) {
-  DSched sched(DSched::uniform(0));
-
-  run_pingpong_test<DeterministicAtomic, false, false>(1000);
+  run_pingpong_test<DeterministicAtomic, false>(1000);
 }
 
 /// Timed wait tests - Nonblocking Baton does not support timed_wait()
 
 // Timed wait basic system clock tests
 
-TEST(Baton, timed_wait_basic_system_clock_single_poster) {
-  run_basic_timed_wait_tests<std::atomic, std::chrono::system_clock, true>();
-  run_basic_timed_wait_tests<
-      EmulatedFutexAtomic,
-      std::chrono::system_clock,
-      true>();
-  run_basic_timed_wait_tests<
-      DeterministicAtomic,
-      std::chrono::system_clock,
-      true>();
-}
-
-TEST(Baton, timed_wait_basic_system_clock_multi_poster) {
-  run_basic_timed_wait_tests<std::atomic, std::chrono::system_clock, false>();
-  run_basic_timed_wait_tests<
-      EmulatedFutexAtomic,
-      std::chrono::system_clock,
-      false>();
-  run_basic_timed_wait_tests<
-      DeterministicAtomic,
-      std::chrono::system_clock,
-      false>();
+TEST(Baton, timed_wait_basic_system_clock) {
+  run_basic_timed_wait_tests<std::atomic, std::chrono::system_clock>();
+  run_basic_timed_wait_tests<EmulatedFutexAtomic, std::chrono::system_clock>();
+  run_basic_timed_wait_tests<DeterministicAtomic, std::chrono::system_clock>();
 }
 
 // Timed wait timeout system clock tests
 
-TEST(Baton, timed_wait_timeout_system_clock_single_poster) {
-  run_timed_wait_tmo_tests<std::atomic, std::chrono::system_clock, true>();
-  run_timed_wait_tmo_tests<
-      EmulatedFutexAtomic,
-      std::chrono::system_clock,
-      true>();
-  run_timed_wait_tmo_tests<
-      DeterministicAtomic,
-      std::chrono::system_clock,
-      true>();
-}
-
-TEST(Baton, timed_wait_timeout_system_clock_multi_poster) {
-  run_timed_wait_tmo_tests<std::atomic, std::chrono::system_clock, false>();
-  run_timed_wait_tmo_tests<
-      EmulatedFutexAtomic,
-      std::chrono::system_clock,
-      false>();
-  run_timed_wait_tmo_tests<
-      DeterministicAtomic,
-      std::chrono::system_clock,
-      false>();
+TEST(Baton, timed_wait_timeout_system_clock) {
+  run_timed_wait_tmo_tests<std::atomic, std::chrono::system_clock>();
+  run_timed_wait_tmo_tests<EmulatedFutexAtomic, std::chrono::system_clock>();
+  run_timed_wait_tmo_tests<DeterministicAtomic, std::chrono::system_clock>();
 }
 
 // Timed wait regular system clock tests
 
-TEST(Baton, timed_wait_system_clock_single_poster) {
-  run_timed_wait_regular_test<std::atomic, std::chrono::system_clock, true>();
-  run_timed_wait_regular_test<
-      EmulatedFutexAtomic,
-      std::chrono::system_clock,
-      true>();
-  run_timed_wait_regular_test<
-      DeterministicAtomic,
-      std::chrono::system_clock,
-      true>();
-}
-
-TEST(Baton, timed_wait_system_clock_multi_poster) {
-  run_timed_wait_regular_test<std::atomic, std::chrono::system_clock, false>();
-  run_timed_wait_regular_test<
-      EmulatedFutexAtomic,
-      std::chrono::system_clock,
-      false>();
-  run_timed_wait_regular_test<
-      DeterministicAtomic,
-      std::chrono::system_clock,
-      false>();
+TEST(Baton, timed_wait_system_clock) {
+  run_timed_wait_regular_test<std::atomic, std::chrono::system_clock>();
+  run_timed_wait_regular_test<EmulatedFutexAtomic, std::chrono::system_clock>();
+  run_timed_wait_regular_test<DeterministicAtomic, std::chrono::system_clock>();
 }
 
 // Timed wait basic steady clock tests
 
-TEST(Baton, timed_wait_basic_steady_clock_single_poster) {
-  run_basic_timed_wait_tests<std::atomic, std::chrono::steady_clock, true>();
-  run_basic_timed_wait_tests<
-      EmulatedFutexAtomic,
-      std::chrono::steady_clock,
-      true>();
-  run_basic_timed_wait_tests<
-      DeterministicAtomic,
-      std::chrono::steady_clock,
-      true>();
-}
-
-TEST(Baton, timed_wait_basic_steady_clock_multi_poster) {
-  run_basic_timed_wait_tests<std::atomic, std::chrono::steady_clock, false>();
-  run_basic_timed_wait_tests<
-      EmulatedFutexAtomic,
-      std::chrono::steady_clock,
-      false>();
-  run_basic_timed_wait_tests<
-      DeterministicAtomic,
-      std::chrono::steady_clock,
-      false>();
+TEST(Baton, timed_wait_basic_steady_clock) {
+  run_basic_timed_wait_tests<std::atomic, std::chrono::steady_clock>();
+  run_basic_timed_wait_tests<EmulatedFutexAtomic, std::chrono::steady_clock>();
+  run_basic_timed_wait_tests<DeterministicAtomic, std::chrono::steady_clock>();
 }
 
 // Timed wait timeout steady clock tests
 
-TEST(Baton, timed_wait_timeout_steady_clock_single_poster) {
-  run_timed_wait_tmo_tests<std::atomic, std::chrono::steady_clock, true>();
-  run_timed_wait_tmo_tests<
-      EmulatedFutexAtomic,
-      std::chrono::steady_clock,
-      true>();
-  run_timed_wait_tmo_tests<
-      DeterministicAtomic,
-      std::chrono::steady_clock,
-      true>();
-}
-
-TEST(Baton, timed_wait_timeout_steady_clock_multi_poster) {
-  run_timed_wait_tmo_tests<std::atomic, std::chrono::steady_clock, false>();
-  run_timed_wait_tmo_tests<
-      EmulatedFutexAtomic,
-      std::chrono::steady_clock,
-      false>();
-  run_timed_wait_tmo_tests<
-      DeterministicAtomic,
-      std::chrono::steady_clock,
-      false>();
+TEST(Baton, timed_wait_timeout_steady_clock) {
+  run_timed_wait_tmo_tests<std::atomic, std::chrono::steady_clock>();
+  run_timed_wait_tmo_tests<EmulatedFutexAtomic, std::chrono::steady_clock>();
+  run_timed_wait_tmo_tests<DeterministicAtomic, std::chrono::steady_clock>();
 }
 
 // Timed wait regular steady clock tests
 
-TEST(Baton, timed_wait_steady_clock_single_poster) {
-  run_timed_wait_regular_test<std::atomic, std::chrono::steady_clock, true>();
-  run_timed_wait_regular_test<
-      EmulatedFutexAtomic,
-      std::chrono::steady_clock,
-      true>();
-  run_timed_wait_regular_test<
-      DeterministicAtomic,
-      std::chrono::steady_clock,
-      true>();
-}
-
-TEST(Baton, timed_wait_steady_clock_multi_poster) {
-  run_timed_wait_regular_test<std::atomic, std::chrono::steady_clock, false>();
-  run_timed_wait_regular_test<
-      EmulatedFutexAtomic,
-      std::chrono::steady_clock,
-      false>();
-  run_timed_wait_regular_test<
-      DeterministicAtomic,
-      std::chrono::steady_clock,
-      false>();
+TEST(Baton, timed_wait_steady_clock) {
+  run_timed_wait_regular_test<std::atomic, std::chrono::steady_clock>();
+  run_timed_wait_regular_test<EmulatedFutexAtomic, std::chrono::steady_clock>();
+  run_timed_wait_regular_test<DeterministicAtomic, std::chrono::steady_clock>();
 }
 
 /// Try wait tests
 
-TEST(Baton, try_wait_single_poster_blocking) {
-  run_try_wait_tests<std::atomic, true, true>();
-  run_try_wait_tests<EmulatedFutexAtomic, true, true>();
-  run_try_wait_tests<DeterministicAtomic, true, true>();
-}
-
-TEST(Baton, try_wait_single_poster_nonblocking) {
-  run_try_wait_tests<std::atomic, true, false>();
-  run_try_wait_tests<EmulatedFutexAtomic, true, false>();
-  run_try_wait_tests<DeterministicAtomic, true, false>();
-}
-
-TEST(Baton, try_wait_multi_poster_blocking) {
-  run_try_wait_tests<std::atomic, false, true>();
-  run_try_wait_tests<EmulatedFutexAtomic, false, true>();
-  run_try_wait_tests<DeterministicAtomic, false, true>();
-}
-
-TEST(Baton, try_wait_multi_poster_nonblocking) {
-  run_try_wait_tests<std::atomic, false, false>();
-  run_try_wait_tests<EmulatedFutexAtomic, false, false>();
-  run_try_wait_tests<DeterministicAtomic, false, false>();
-}
-
-/// Multi-producer tests
-
-TEST(Baton, multi_producer_single_poster_blocking) {
-  run_try_wait_tests<std::atomic, true, true>();
-  run_try_wait_tests<EmulatedFutexAtomic, true, true>();
-  run_try_wait_tests<DeterministicAtomic, true, true>();
-}
-
-TEST(Baton, multi_producer_single_poster_nonblocking) {
-  run_try_wait_tests<std::atomic, true, false>();
-  run_try_wait_tests<EmulatedFutexAtomic, true, false>();
-  run_try_wait_tests<DeterministicAtomic, true, false>();
-}
-
-TEST(Baton, multi_producer_multi_poster_blocking) {
-  run_try_wait_tests<std::atomic, false, true>();
-  run_try_wait_tests<EmulatedFutexAtomic, false, true>();
-  run_try_wait_tests<DeterministicAtomic, false, true>();
+TEST(Baton, try_wait_blocking) {
+  run_try_wait_tests<std::atomic, true>();
+  run_try_wait_tests<EmulatedFutexAtomic, true>();
+  run_try_wait_tests<DeterministicAtomic, true>();
 }
 
-TEST(Baton, multi_producer_multi_poster_nonblocking) {
-  run_try_wait_tests<std::atomic, false, false>();
-  run_try_wait_tests<EmulatedFutexAtomic, false, false>();
-  run_try_wait_tests<DeterministicAtomic, false, false>();
+TEST(Baton, try_wait_nonblocking) {
+  run_try_wait_tests<std::atomic, false>();
+  run_try_wait_tests<EmulatedFutexAtomic, false>();
+  run_try_wait_tests<DeterministicAtomic, false>();
 }