If you find nothing to do you must wake up someone with a higher mandate.
@@ -1023,7 +1023,14 @@ FileStorHandlerImpl::Stripe::schedule_and_get_next_async_message(MessageEntry en
{
std::unique_lock guard(*_lock);
_queue->emplace_back(std::move(entry));
- return get_next_async_message(guard);
+ auto lockedMessage = get_next_async_message(guard);
+ if ( ! lockedMessage.second) {
+ if (guard.owns_lock()) {
+ guard.unlock();
+ }
+ _cond->notify_all();
+ }
+ return lockedMessage;
}
void
