mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 11:42:28 +00:00 
			
		
		
		
	support threading for TRACE mode
This commit is contained in:
		
							parent
							
								
									4b7c08d08d
								
							
						
					
					
						commit
						3036b88f09
					
				
					 7 changed files with 64 additions and 55 deletions
				
			
		|  | @ -19,6 +19,25 @@ Revision History: | |||
| #include "util/trace.h" | ||||
| #include "util/str_hashtable.h" | ||||
| 
 | ||||
| #ifndef SINGLE_THREAD | ||||
| #include <mutex> | ||||
| #include <thread> | ||||
| 
 | ||||
| static std::mutex g_verbose_mux; | ||||
| void verbose_lock() { g_verbose_mux.lock(); } | ||||
| void verbose_unlock() { g_verbose_mux.unlock(); } | ||||
| 
 | ||||
| static std::thread::id g_thread_id = std::this_thread::get_id(); | ||||
| static bool g_is_threaded = false; | ||||
| 
 | ||||
| bool is_threaded() { | ||||
|     if (g_is_threaded) return true; | ||||
|     g_is_threaded = std::this_thread::get_id() != g_thread_id; | ||||
|     return g_is_threaded; | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _TRACE | ||||
| 
 | ||||
| std::ofstream tout(".z3-trace");  | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue