diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2017-03-19 13:11:39 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2017-03-19 13:11:39 +0100 |
commit | 367557039aae419f28c2ff44700f77bec8f498e4 (patch) | |
tree | 2626da5314a55097b697da75a0dd8bf646b910b3 /ringbuffer.h | |
parent | 31b0feae145a943e4fb99d5fa2e2f83466516606 (diff) | |
download | vdr-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.h')
-rw-r--r-- | ringbuffer.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ringbuffer.h b/ringbuffer.h index 9699bbc8..746fc51e 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 4.1 2016/12/22 10:26:13 kls Exp $ + * $Id: ringbuffer.h 4.2 2017/03/19 13:11:39 kls Exp $ */ #ifndef __RINGBUFFER_H @@ -80,6 +80,8 @@ public: virtual int Free(void) { return Size() - Available() - 1 - margin; } virtual void Clear(void); ///< Immediately clears the ring buffer. + ///< This function may safely be called from the reading thread without additional + ///< locking. If called from the writing thread, proper locking must be used. int Read(int FileHandle, int Max = 0); ///< Reads at most Max bytes from FileHandle and stores them in the ///< ring buffer. If Max is 0, reads as many bytes as possible. |