On 15/02/2023 16:51, Klaus Schmidinger wrote:
On 09.02.23 23:31, Patrick Lerda wrote:
... This is really related to the C++ thread safety model, the patch below fixes the main cRingBufferLinear issue:
diff --git a/ringbuffer.h b/ringbuffer.h index 746fc51..a3fa499 100644 --- a/ringbuffer.h +++ b/ringbuffer.h @@ -10,6 +10,7 @@ #ifndef __RINGBUFFER_H #define __RINGBUFFER_H
+#include <atomic> #include "thread.h" #include "tools.h"
@@ -58,7 +59,8 @@ public: static void PrintDebugRBL(void); #endif private: - int margin, head, tail; + int margin; + std::atomic_int head, tail; int gotten; uchar *buffer; char *description;
Is there an actual, reproducable, real world problem that makes this necessary? I mean without any "thread sanitizer" etc.
Klaus
I had definitively a few crashes related to this class. Thread safety issues are often not easily reproducible. Is your environment 100% reliable?
Patrick
vdr mailing list vdr@linuxtv.org https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr