Commit 962619c3 authored by Dominik Charousset's avatar Dominik Charousset

Extend API to allow locking by client code

parent 8a95d34f
...@@ -192,6 +192,17 @@ public: ...@@ -192,6 +192,17 @@ public:
return max_in_flight_; return max_in_flight_;
} }
/// Returns the mutex for this object.
auto& mtx() const noexcept {
return mtx_;
}
/// Returns how many items are currently available.
/// @pre 'mtx()' is locked.
size_t available_unsafe() const noexcept {
return buf_.size();
}
private: private:
void ready() { void ready() {
producer_->on_consumer_ready(); producer_->on_consumer_ready();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment