Page Speed Optimization Libraries
1.4.26.1
|
Public Member Functions | |
PthreadCondvar (PthreadMutex *mutex) | |
The mutex is owned by the caller and must outlive the condvar. | |
virtual PthreadMutex * | mutex () const |
Return the mutex associated with this condition variable. | |
virtual void | Signal () |
virtual void | Broadcast () |
virtual void | Wait () |
virtual void | TimedWait (int64 timeout_ms) |
virtual void net_instaweb::PthreadCondvar::Broadcast | ( | ) | [virtual] |
Broadcast to all threads waiting on condvar. mutex() must be held as with Signal().
Implements net_instaweb::ThreadSystem::Condvar.
virtual void net_instaweb::PthreadCondvar::Signal | ( | ) | [virtual] |
Signal the condvar, waking a waiting thread if any. mutex() must be held by caller. Example: { ScopedMutex lock(cv.mutex()); make_resource_available(); cv.Signal(); }
Implements net_instaweb::ThreadSystem::Condvar.
virtual void net_instaweb::PthreadCondvar::TimedWait | ( | int64 | timeout_ms | ) | [virtual] |
Wait for condition to be signaled, or timeout to occur. Works like Wait(), and cv.mutex() must be held on entry and re-taken on exit.
Implements net_instaweb::ThreadSystem::Condvar.
virtual void net_instaweb::PthreadCondvar::Wait | ( | ) | [virtual] |
Wait for condition to be signaled. mutex() must be held; it will be released and then reclaimed when a signal is received. Note that a Wait() may be terminated based on a condition being true, but the condition may no longer be true at the time the thread wakes up. Example: { ScopedMutex lock(cv.mutex()); while (status && !resource_available()) status = cv.wait(); if (status) { use_resource(); } }
Implements net_instaweb::ThreadSystem::Condvar.