Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pthread_condvar.h
Go to the documentation of this file.
1 // Copyright 2011 Google Inc.
16 
17 #ifndef PAGESPEED_KERNEL_THREAD_PTHREAD_CONDVAR_H_
18 #define PAGESPEED_KERNEL_THREAD_PTHREAD_CONDVAR_H_
19 
20 #include <pthread.h>
21 
26 
27 namespace net_instaweb {
28 
30  public:
33  : mutex_(mutex) {
34  Init();
35  }
36  virtual ~PthreadCondvar();
37 
38  virtual PthreadMutex* mutex() const { return mutex_; }
39 
40  virtual void Signal();
41  virtual void Broadcast();
42  virtual void Wait();
43  virtual void TimedWait(int64 timeout_ms);
44 
45  private:
46  void Init();
47 
48  PthreadMutex* mutex_;
49  pthread_cond_t condvar_;
50 
51 
52 };
53 
54 }
55 
56 #endif
Definition: condvar.h:27
Implementation of ThreadSystem::CondvarCapableMutexMutex for Pthread mutexes.
Definition: pthread_mutex.h:29
PthreadCondvar(PthreadMutex *mutex)
The mutex is owned by the caller and must outlive the condvar.
Definition: pthread_condvar.h:32
Definition: pthread_condvar.h:29
virtual void TimedWait(int64 timeout_ms)
virtual PthreadMutex * mutex() const
Return the mutex associated with this condition variable.
Definition: pthread_condvar.h:38