summaryrefslogtreecommitdiff
path: root/ringbuffer.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-03-19 13:11:39 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2017-03-19 13:11:39 +0100
commit367557039aae419f28c2ff44700f77bec8f498e4 (patch)
tree2626da5314a55097b697da75a0dd8bf646b910b3 /ringbuffer.c
parent31b0feae145a943e4fb99d5fa2e2f83466516606 (diff)
downloadvdr-367557039aae419f28c2ff44700f77bec8f498e4.tar.gz
vdr-367557039aae419f28c2ff44700f77bec8f498e4.tar.bz2
The function cRingBufferLinear::Clear() can now be called safely from the reading thread, without additional locking
Diffstat (limited to 'ringbuffer.c')
-rw-r--r--ringbuffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ringbuffer.c b/ringbuffer.c
index d33a4719..902c8878 100644
--- a/ringbuffer.c
+++ b/ringbuffer.c
@@ -7,7 +7,7 @@
* Parts of this file were inspired by the 'ringbuffy.c' from the
* LinuxDVB driver (see linuxtv.org).
*
- * $Id: ringbuffer.c 4.1 2016/12/22 10:26:13 kls Exp $
+ * $Id: ringbuffer.c 4.2 2017/03/19 12:43:36 kls Exp $
*/
#include "ringbuffer.h"
@@ -216,9 +216,10 @@ int cRingBufferLinear::Available(void)
void cRingBufferLinear::Clear(void)
{
- tail = head = margin;
+ int Head = head;
+ tail = Head;
#ifdef DEBUGRINGBUFFERS
- lastHead = head;
+ lastHead = Head;
lastTail = tail;
lastPut = lastGet = -1;
#endif