mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-13 01:10:26 +08:00
Update async_log_helper.h
removed empty lines
This commit is contained in:
parent
38456118d0
commit
e7ec922c0a
@ -229,8 +229,6 @@ inline spdlog::details::async_log_helper::~async_log_helper()
|
|||||||
inline void spdlog::details::async_log_helper::log(const details::log_msg& msg)
|
inline void spdlog::details::async_log_helper::log(const details::log_msg& msg)
|
||||||
{
|
{
|
||||||
push_msg(async_msg(msg));
|
push_msg(async_msg(msg));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void spdlog::details::async_log_helper::push_msg(details::async_log_helper::async_msg&& new_msg)
|
inline void spdlog::details::async_log_helper::push_msg(details::async_log_helper::async_msg&& new_msg)
|
||||||
@ -246,7 +244,6 @@ inline void spdlog::details::async_log_helper::push_msg(details::async_log_helpe
|
|||||||
}
|
}
|
||||||
while (!_q.enqueue(std::move(new_msg)));
|
while (!_q.enqueue(std::move(new_msg)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// optionally wait for the queue be empty and request flush from the sinks
|
// optionally wait for the queue be empty and request flush from the sinks
|
||||||
@ -281,10 +278,8 @@ inline void spdlog::details::async_log_helper::worker_loop()
|
|||||||
// return true if this thread should still be active (while no terminate msg was received)
|
// return true if this thread should still be active (while no terminate msg was received)
|
||||||
inline bool spdlog::details::async_log_helper::process_next_msg(log_clock::time_point& last_pop, log_clock::time_point& last_flush)
|
inline bool spdlog::details::async_log_helper::process_next_msg(log_clock::time_point& last_pop, log_clock::time_point& last_flush)
|
||||||
{
|
{
|
||||||
|
|
||||||
async_msg incoming_async_msg;
|
async_msg incoming_async_msg;
|
||||||
|
|
||||||
|
|
||||||
if (_q.dequeue(incoming_async_msg))
|
if (_q.dequeue(incoming_async_msg))
|
||||||
{
|
{
|
||||||
last_pop = details::os::now();
|
last_pop = details::os::now();
|
||||||
@ -361,7 +356,6 @@ inline void spdlog::details::async_log_helper::sleep_or_yield(const spdlog::log_
|
|||||||
if (time_since_op <= microseconds(100))
|
if (time_since_op <= microseconds(100))
|
||||||
return std::this_thread::yield();
|
return std::this_thread::yield();
|
||||||
|
|
||||||
|
|
||||||
// sleep for 20 ms upto 200 ms
|
// sleep for 20 ms upto 200 ms
|
||||||
if (time_since_op <= milliseconds(200))
|
if (time_since_op <= milliseconds(200))
|
||||||
return sleep_for(milliseconds(20));
|
return sleep_for(milliseconds(20));
|
||||||
@ -378,13 +372,7 @@ inline void spdlog::details::async_log_helper::wait_empty_q()
|
|||||||
{
|
{
|
||||||
sleep_or_yield(details::os::now(), last_op);
|
sleep_or_yield(details::os::now(), last_op);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user