Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
net_instaweb::PthreadCondvar Class Reference
Inheritance diagram for net_instaweb::PthreadCondvar:

Public Member Functions

 PthreadCondvar (PthreadMutex *mutex)
 The mutex is owned by the caller and must outlive the condvar.
virtual PthreadMutexmutex () const
 Return the mutex associated with this condition variable.
virtual void Signal ()
virtual void Broadcast ()
virtual void Wait ()
virtual void TimedWait (int64 timeout_ms)

Member Function Documentation

virtual void net_instaweb::PthreadCondvar::Broadcast ( )

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 ( )

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)

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 ( )

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.

The documentation for this class was generated from the following file: