summaryrefslogtreecommitdiff
path: root/Kernel/DoubleBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/DoubleBuffer.h')
-rw-r--r--Kernel/DoubleBuffer.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Kernel/DoubleBuffer.h b/Kernel/DoubleBuffer.h
index b855fb8853..6db3718b8e 100644
--- a/Kernel/DoubleBuffer.h
+++ b/Kernel/DoubleBuffer.h
@@ -29,6 +29,7 @@
#include <AK/Types.h>
#include <Kernel/KBuffer.h>
#include <Kernel/Lock.h>
+#include <Kernel/Thread.h>
#include <Kernel/UserOrKernelBuffer.h>
namespace Kernel {
@@ -53,6 +54,12 @@ public:
size_t space_for_writing() const { return m_space_for_writing; }
+ void set_unblock_callback(Function<void()> callback)
+ {
+ ASSERT(!m_unblock_callback);
+ m_unblock_callback = move(callback);
+ }
+
private:
void flip();
void compute_lockfree_metadata();
@@ -68,6 +75,7 @@ private:
InnerBuffer m_buffer2;
KBuffer m_storage;
+ Function<void()> m_unblock_callback;
size_t m_capacity { 0 };
size_t m_read_buffer_index { 0 };
size_t m_space_for_writing { 0 };