Currently this is the same as flush, but more precisely it is an internal
method that means all txc's must complete. Update _wal_apply() to use it
instead of flush(), which is part of the public Sequencer interface.
Signed-off-by: Sage Weil <sage@redhat.com>
txc->state = TransContext::STATE_KV_DONE;
_txc_state_proc(txc);
}
- dout(20) << __func__ << " flushing osr" << dendl;
- osr->flush();
+ dout(20) << __func__ << " draining osr" << dendl;
+ osr->drain();
dout(10) << __func__ << " completed " << count << " events" << dendl;
return 0;
}
q.push_back(*txc);
}
- void flush() {
+ void flush() override {
+ std::unique_lock<std::mutex> l(qlock);
+ while (!q.empty())
+ qcond.wait(l);
+ }
+
+ void drain() {
std::unique_lock<std::mutex> l(qlock);
while (!q.empty())
qcond.wait(l);
}
- bool flush_commit(Context *c) {
+ bool flush_commit(Context *c) override {
std::lock_guard<std::mutex> l(qlock);
if (q.empty()) {
return true;