mirror of
				https://github.com/N64Recomp/N64ModernRuntime.git
				synced 2025-10-30 08:02:29 +00:00 
			
		
		
		
	Fix race condition where update_gfx could be called after renderer shutdown (#98)
This commit is contained in:
		
							parent
							
								
									db1b1a1082
								
							
						
					
					
						commit
						8506c1b588
					
				
					 2 changed files with 5 additions and 0 deletions
				
			
		|  | @ -502,6 +502,7 @@ bool ultramodern::is_game_started() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::atomic_bool exited = false; | std::atomic_bool exited = false; | ||||||
|  | moodycamel::LightweightSemaphore graphics_shutdown_ready; | ||||||
| 
 | 
 | ||||||
| void ultramodern::quit() { | void ultramodern::quit() { | ||||||
|     exited.store(true); |     exited.store(true); | ||||||
|  | @ -763,6 +764,8 @@ void recomp::start( | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     graphics_shutdown_ready.signal(); | ||||||
|  | 
 | ||||||
|     game_thread.join(); |     game_thread.join(); | ||||||
|     ultramodern::join_event_threads(); |     ultramodern::join_event_threads(); | ||||||
|     ultramodern::join_thread_cleaner_thread(); |     ultramodern::join_thread_cleaner_thread(); | ||||||
|  |  | ||||||
|  | @ -105,6 +105,7 @@ uint64_t total_vis = 0; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| extern std::atomic_bool exited; | extern std::atomic_bool exited; | ||||||
|  | extern moodycamel::LightweightSemaphore graphics_shutdown_ready; | ||||||
| 
 | 
 | ||||||
| void set_dummy_vi(); | void set_dummy_vi(); | ||||||
| 
 | 
 | ||||||
|  | @ -318,6 +319,7 @@ void gfx_thread_func(uint8_t* rdram, moodycamel::LightweightSemaphore* thread_re | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     graphics_shutdown_ready.wait(); | ||||||
|     renderer_context->shutdown(); |     renderer_context->shutdown(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Wiseguy
						Wiseguy