As noted in commit
cc7ec3e18d1, there is only ever a single `Finisher`
thread, therefore the overhead for `notify_all()` can be eliminated.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
finisher_stop = true;
// we don't have any new work to do, but we want the worker to wake up anyway
// to process the stop condition.
- finisher_cond.notify_all();
+ finisher_cond.notify_one();
finisher_lock.unlock();
finisher_thread.join(); // wait until the worker exits completely
ldout(cct, 10) << __func__ << " finish" << dendl;
finisher_queue.push_back(std::make_pair(i, 0));
}
if (should_notify) {
- finisher_cond.notify_all();
+ finisher_cond.notify_one();
}
}
if (logger)