aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/BufferManager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/BufferManager.hpp')
-rw-r--r--src/profiling/BufferManager.hpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/profiling/BufferManager.hpp b/src/profiling/BufferManager.hpp
index 495b113867..d678cd3ec0 100644
--- a/src/profiling/BufferManager.hpp
+++ b/src/profiling/BufferManager.hpp
@@ -6,6 +6,7 @@
#pragma once
#include "IBufferManager.hpp"
+#include "IConsumer.hpp"
#include <condition_variable>
#include <mutex>
@@ -28,7 +29,7 @@ public:
void Reset();
- void Commit(IPacketBufferPtr& packetBuffer, unsigned int size) override;
+ void Commit(IPacketBufferPtr& packetBuffer, unsigned int size, bool notifyConsumer = true) override;
void Release(IPacketBufferPtr& packetBuffer) override;
@@ -36,6 +37,13 @@ public:
void MarkRead(IPacketBufferPtr& packetBuffer) override;
+ /// Set Consumer on the buffer manager to be notified when there is a Commit
+ /// Can only be one consumer
+ void SetConsumer(IConsumer* consumer) override;
+
+ /// Notify the Consumer buffer can be read
+ void FlushReadList() override;
+
private:
void Initialize();
@@ -55,6 +63,9 @@ private:
// Mutex for readable packet buffer list
std::mutex m_ReadableMutex;
+
+ // Consumer thread to notify packet is ready to read
+ IConsumer* m_Consumer = nullptr;
};
} // namespace profiling