|
typedef void(ThreadSystem::Condvar::* | SignalMethod )() |
|
|
static void * | HelperThread (void *data) |
|
void net_instaweb::CondvarTestBase::BlindSignalsTest |
( |
| ) |
|
|
inlineprotected |
virtual void net_instaweb::CondvarTestBase::CreateHelper |
( |
| ) |
|
|
protectedpure virtual |
CreateHelper creates a thread that ultimately calls this->HelperThreadMethod(), most simply by invoking HelperThread(this). It runs this method to completion, and then terminates gracefully.
virtual void net_instaweb::CondvarTestBase::FinishHelper |
( |
| ) |
|
|
protectedpure virtual |
FinishHelper is called in the main thread to wait for graceful termination of the thread created by CreateHelper.
virtual void net_instaweb::CondvarTestBase::HelperThreadMethod |
( |
| ) |
|
|
inlineprotectedvirtual |
We must hold the mutex to access the iteration count and check the loop condition.
Init is intended to be called from the constructor of the derived class. Ownership of the objects remains with the caller.
void net_instaweb::CondvarTestBase::LongTimeoutTest |
( |
int |
wait_ms | ) |
|
|
inlineprotected |
Make sure that a long timeout doesn't exit too early.
This test should not be flaky even if it runs slowly, as we are not placing an upper bound on the lock duration.
void net_instaweb::CondvarTestBase::PingPongTest |
( |
| ) |
|
|
inlineprotected |
Use condvars to pass control back and forth between worker and main thread. Also run with signal_method_ = &ThreadSystem::Condvar::Broadcast
We must hold the mutex to access the iteration count and check the loop condition.
void net_instaweb::CondvarTestBase::StartupTest |
( |
| ) |
|
|
inlineprotected |
Below are the common tests that should be run by every client.
Make sure we can start and stop the helper gracefully.
void net_instaweb::CondvarTestBase::TimeoutPingPongTest |
( |
| ) |
|
|
inlineprotected |
Use condvars to pass control back and forth between worker and main thread. Final interaction will be one-sided and will time out. Also run with signal_method_ = &ThreadSystem::Condvar::Broadcast
We must hold the mutex to access the iteration count and check the loop condition. Note that in case of timeout we might get here with current_iter_ % 2 == 0, so we might perform more local increments than we expect.
void net_instaweb::CondvarTestBase::TimeoutTest |
( |
| ) |
|
|
inlineprotected |
Make sure that TimedWait eventually progresses in the absence of a signal.
< This will deadlock if we don't time out.
The documentation for this class was generated from the following file: