mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-30 19:22:28 +00:00 
			
		
		
		
	addressing race condition on interrupts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									c0895e5548
								
							
						
					
					
						commit
						ec121db5c1
					
				
					 1 changed files with 21 additions and 8 deletions
				
			
		|  | @ -54,13 +54,19 @@ static void display_statistics() { | |||
| } | ||||
| 
 | ||||
| static void on_timeout() { | ||||
|     display_statistics(); | ||||
|     exit(0); | ||||
|     #pragma omp critical (g_display_stats)  | ||||
|     { | ||||
|         display_statistics(); | ||||
|         exit(0); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| static void on_ctrl_c(int) { | ||||
|     signal (SIGINT, SIG_DFL); | ||||
|     display_statistics(); | ||||
|     #pragma omp critical (g_display_stats)  | ||||
|     { | ||||
|         display_statistics(); | ||||
|     } | ||||
|     raise(SIGINT); | ||||
| } | ||||
| 
 | ||||
|  | @ -83,9 +89,12 @@ unsigned read_smtlib_file(char const * benchmark_file) { | |||
|         } | ||||
|     } | ||||
|      | ||||
|     display_statistics(); | ||||
|     register_on_timeout_proc(0); | ||||
|     g_solver = 0; | ||||
|     #pragma omp critical (g_display_stats)  | ||||
|     { | ||||
|         display_statistics(); | ||||
|         register_on_timeout_proc(0); | ||||
|         g_solver = 0; | ||||
|     } | ||||
|     return solver.get_error_code(); | ||||
| } | ||||
| 
 | ||||
|  | @ -118,8 +127,12 @@ unsigned read_smtlib2_commands(char const * file_name) { | |||
|         result = parse_smt2_commands(ctx, std::cin, true); | ||||
|     } | ||||
|      | ||||
|     display_statistics(); | ||||
|     g_cmd_context = 0; | ||||
| 
 | ||||
|     #pragma omp critical (g_display_stats)  | ||||
|     { | ||||
|         display_statistics(); | ||||
|         g_cmd_context = 0; | ||||
|     } | ||||
|     return result ? 0 : 1; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue