fix flush async flush

This commit is contained in:
Gabi Melman 2016-09-03 01:33:07 +03:00 committed by GitHub
parent 3ee1bab316
commit d01e288afc

View File

@ -133,7 +133,7 @@ public:
void set_formatter(formatter_ptr);
void flush();
void flush(bool wait_for_q);
private:
@ -249,12 +249,12 @@ 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()
// optionally wait for the queue be empty and request flush from the sinks
inline void spdlog::details::async_log_helper::flush(bool wait_for_q)
{
wait_empty_q();
push_msg(async_msg(async_msg_type::flush));
wait_empty_q(); //make sure the above flush message was processed
if(wait_for_q)
wait_empty_q(); //return only make after the above flush message was processed
}
inline void spdlog::details::async_log_helper::worker_loop()