summaryrefslogtreecommitdiff
path: root/thread.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-10-16 09:36:28 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2004-10-16 09:36:28 +0200
commit6415cc900de3361925d22f879077be687fce3858 (patch)
tree98ab10cda016e125e33966e371ccfe01e5fd9bd1 /thread.h
parent15030f6acece1060f9736f875fe3abbcf9392263 (diff)
downloadvdr-6415cc900de3361925d22f879077be687fce3858.tar.gz
vdr-6415cc900de3361925d22f879077be687fce3858.tar.bz2
Improved buffer handling
Diffstat (limited to 'thread.h')
-rw-r--r--thread.h20
1 files changed, 18 insertions, 2 deletions
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 <stdio.h>
#include <sys/types.h>
+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 {