We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b6defe commit 97a9772Copy full SHA for 97a9772
src/Sink.hpp
@@ -43,7 +43,29 @@ class SinkBase
43
template<typename T>
44
class SinkNonBlocking : public SinkBase<T>
45
{
46
- /* TODO - Do we really need this? */
+public:
47
+
48
+ SinkNonBlocking();
49
+ virtual ~SinkNonBlocking() { }
50
51
+ virtual T read() override
52
+ {
53
+ _mutex.lock();
54
+ return _data;
55
+ _mutex.unlock();
56
+ }
57
+ virtual void inject(T const & value) override
58
59
60
+ _data = value;
61
62
63
64
+private:
65
66
+ T _data;
67
+ rtos::Mutex _mutex;
68
69
};
70
71
0 commit comments