mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-105716: Update interp->threads.main After Fork (gh-117049)
I missed this in gh-109921. We also update Py_Exit() to call _PyInterpreterState_SetNotRunningMain(), if necessary.
This commit is contained in:
		
							parent
							
								
									bbee57fa8c
								
							
						
					
					
						commit
						5a76d1be8e
					
				
					 4 changed files with 46 additions and 0 deletions
				
			
		|  | @ -3138,6 +3138,10 @@ call_ll_exitfuncs(_PyRuntimeState *runtime) | |||
| void _Py_NO_RETURN | ||||
| Py_Exit(int sts) | ||||
| { | ||||
|     PyThreadState *tstate = _PyThreadState_GET(); | ||||
|     if (tstate != NULL && _PyThreadState_IsRunningMain(tstate)) { | ||||
|         _PyInterpreterState_SetNotRunningMain(tstate->interp); | ||||
|     } | ||||
|     if (Py_FinalizeEx() < 0) { | ||||
|         sts = 120; | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Eric Snow
						Eric Snow