proxygen
|
#include <folly/synchronization/SaturatingSemaphore.h>
#include <folly/portability/GTest.h>
#include <folly/test/DeterministicSchedule.h>
Go to the source code of this file.
Typedefs | |
using | DSched = folly::test::DeterministicSchedule |
Functions | |
template<bool MayBlock, template< typename > class Atom = std::atomic> | |
void | run_basic_test () |
template<bool MayBlock, template< typename > class Atom = std::atomic> | |
void | run_pingpong_test (int numRounds) |
template<bool MayBlock, template< typename > class Atom = std::atomic> | |
void | run_multi_poster_multi_waiter_test (int np, int nw) |
TEST (SaturatingSemaphore, basic_spin_only) | |
Tests. More... | |
TEST (SaturatingSemaphore, basic_may_block) | |
TEST (SaturatingSemaphore, pingpong_spin_only) | |
TEST (SaturatingSemaphore, pingpong_may_block) | |
TEST (SaturatingSemaphore, multi_poster_multi_waiter_spin_only) | |
TEST (SaturatingSemaphore, multi_poster_multi_waiter_may_block) | |
Definition at line 24 of file SaturatingSemaphoreTest.cpp.
void run_basic_test | ( | ) |
Definition at line 27 of file SaturatingSemaphoreTest.cpp.
References ASSERT_FALSE, ASSERT_TRUE, Atom, f, now(), folly::SaturatingSemaphore< MayBlock, Atom >::post(), folly::SaturatingSemaphore< MayBlock, Atom >::ready(), folly::SaturatingSemaphore< MayBlock, Atom >::reset(), folly::SaturatingSemaphore< MayBlock, Atom >::try_wait(), folly::SaturatingSemaphore< MayBlock, Atom >::try_wait_until(), folly::SaturatingSemaphore< MayBlock, Atom >::wait(), and folly::SaturatingSemaphore< MayBlock, Atom >::wait_options().
void run_multi_poster_multi_waiter_test | ( | int | np, |
int | nw | ||
) |
Definition at line 73 of file SaturatingSemaphoreTest.cpp.
References ASSERT_FALSE, ASSERT_TRUE, f, i, folly::test::DeterministicSchedule::join(), now(), folly::SaturatingSemaphore< MayBlock, Atom >::post(), folly::SaturatingSemaphore< MayBlock, Atom >::ready(), folly::pushmi::detail::t, folly::test::DeterministicSchedule::thread(), folly::SaturatingSemaphore< MayBlock, Atom >::try_wait(), folly::SaturatingSemaphore< MayBlock, Atom >::try_wait_for(), folly::SaturatingSemaphore< MayBlock, Atom >::try_wait_until(), folly::SaturatingSemaphore< MayBlock, Atom >::wait(), and folly::SaturatingSemaphore< MayBlock, Atom >::wait_options().
void run_pingpong_test | ( | int | numRounds | ) |
Definition at line 50 of file SaturatingSemaphoreTest.cpp.
References a, Atom, b, i, folly::test::DeterministicSchedule::join(), and folly::test::DeterministicSchedule::thread().
TEST | ( | SaturatingSemaphore | , |
basic_spin_only | |||
) |
Tests.
Definition at line 137 of file SaturatingSemaphoreTest.cpp.
TEST | ( | SaturatingSemaphore | , |
basic_may_block | |||
) |
Definition at line 141 of file SaturatingSemaphoreTest.cpp.
TEST | ( | SaturatingSemaphore | , |
pingpong_spin_only | |||
) |
Definition at line 145 of file SaturatingSemaphoreTest.cpp.
TEST | ( | SaturatingSemaphore | , |
pingpong_may_block | |||
) |
Definition at line 149 of file SaturatingSemaphoreTest.cpp.
TEST | ( | SaturatingSemaphore | , |
multi_poster_multi_waiter_spin_only | |||
) |
Definition at line 153 of file SaturatingSemaphoreTest.cpp.
TEST | ( | SaturatingSemaphore | , |
multi_poster_multi_waiter_may_block | |||
) |
Definition at line 160 of file SaturatingSemaphoreTest.cpp.