fix flush async flush
This commit is contained in:
		
							parent
							
								
									3ee1bab316
								
							
						
					
					
						commit
						d01e288afc
					
				@ -133,7 +133,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void set_formatter(formatter_ptr);
 | 
					    void set_formatter(formatter_ptr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void flush();
 | 
					    void flush(bool wait_for_q);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					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
 | 
					// optionally wait for the queue be empty and request flush from the sinks
 | 
				
			||||||
inline void spdlog::details::async_log_helper::flush()
 | 
					inline void spdlog::details::async_log_helper::flush(bool wait_for_q)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    wait_empty_q();
 | 
					 | 
				
			||||||
    push_msg(async_msg(async_msg_type::flush));
 | 
					    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()
 | 
					inline void spdlog::details::async_log_helper::worker_loop()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user