summaryrefslogtreecommitdiff
path: root/ringbuffer.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-05-12 17:46:34 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-05-12 17:46:34 +0200
commit1c1fdc5a3f1096c7b2649a6817102685574671a5 (patch)
treea974c5a02be9606d3e44286f9ea737cd5d538024 /ringbuffer.h
parent2a7472b00a310c11a81a2a29794eba03cba1c1d1 (diff)
downloadvdr-1c1fdc5a3f1096c7b2649a6817102685574671a5.tar.gz
vdr-1c1fdc5a3f1096c7b2649a6817102685574671a5.tar.bz2
Re-implemented the WaitForPut/WaitForGet stuff in cRingBuffer, since some plugins actually need this
Diffstat (limited to 'ringbuffer.h')
-rw-r--r--ringbuffer.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/ringbuffer.h b/ringbuffer.h
index 6b256627..15063454 100644
--- a/ringbuffer.h
+++ b/ringbuffer.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ringbuffer.h 1.11 2003/05/11 09:48:23 kls Exp $
+ * $Id: ringbuffer.h 1.12 2003/05/12 17:35:10 kls Exp $
*/
#ifndef __RINGBUFFER_H
@@ -16,11 +16,19 @@
class cRingBuffer {
private:
cMutex mutex;
+ cCondVar readyForPut, readyForGet;
+ cMutex putMutex, getMutex;
+ int putTimeout;
+ int getTimeout;
int size;
protected:
int maxFill;//XXX
int lastPercent;
bool statistics;//XXX
+ void WaitForPut(void);
+ void WaitForGet(void);
+ void EnablePut(void);
+ void EnableGet(void);
virtual void Clear(void) = 0;
virtual int Available(void) = 0;
int Free(void) { return size - Available() - 1; }
@@ -30,6 +38,7 @@ protected:
public:
cRingBuffer(int Size, bool Statistics = false);
virtual ~cRingBuffer();
+ void SetTimeouts(int PutTimeout, int GetTimeout);
};
class cRingBufferLinear : public cRingBuffer {