From 6415cc900de3361925d22f879077be687fce3858 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 16 Oct 2004 09:36:28 +0200 Subject: Improved buffer handling --- thread.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'thread.h') diff --git a/thread.h b/thread.h index 1804a5a6..7d9254c0 100644 --- a/thread.h +++ b/thread.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: thread.h 1.20 2004/01/03 16:58:50 kls Exp $ + * $Id: thread.h 1.21 2004/10/15 13:16:39 kls Exp $ */ #ifndef __THREAD_H @@ -14,6 +14,23 @@ #include #include +class cCondWait { +private: + pthread_mutex_t mutex; + pthread_cond_t cond; + bool signaled; +public: + cCondWait(void); + ~cCondWait(); + bool Wait(int TimeoutMs = 0); + ///< Waits at most TimeoutMs milliseconds for a call to Signal(), or + ///< forever if TimeoutMs is 0. + ///< \return Returns true if Signal() has been called, false it the given + ///< timeout has expired. + void Signal(void); + ///< Signals a caller of Wait() that the condition it is waiting for is met. + }; + class cMutex; class cCondVar { @@ -25,7 +42,6 @@ public: void Wait(cMutex &Mutex); bool TimedWait(cMutex &Mutex, int TimeoutMs); void Broadcast(void); - //void Signal(void); }; class cRwLock { -- cgit v1.2.3