Commit dfa2c7a9 authored by gabime's avatar gabime

async flush now waits for queue to be empty before returning

parent 73a3a323
......@@ -246,8 +246,14 @@ inline void spdlog::details::async_log_helper::push_msg(details::async_log_helpe
}
//wait for the queue be empty and request flush from its sinks
inline void spdlog::details::async_log_helper::flush()
{
auto last_op = details::os::now();
while (_q.approx_size() > 0)
{
sleep_or_yield(details::os::now(), last_op);
}
push_msg(async_msg(async_msg_type::flush));
}
......
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