mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-140544: Always assume that thread locals are available (GH-140690)
Python has required thread local support since 3.12 (see GH-103324). By assuming that thread locals are always supported, we can improve the performance of third-party extensions by allowing them to access the attached thread and interpreter states directly.
This commit is contained in:
		
							parent
							
								
									88ad41fa34
								
							
						
					
					
						commit
						2cefa70eb9
					
				
					 3 changed files with 12 additions and 34 deletions
				
			
		|  | @ -67,9 +67,6 @@ to avoid the expense of doing their own locking). | |||
|    For each of these functions, the GIL must be held by the current thread. | ||||
|  */ | ||||
| 
 | ||||
| #ifndef HAVE_THREAD_LOCAL | ||||
| #  error "no supported thread-local variable storage classifier" | ||||
| #endif | ||||
| 
 | ||||
| /* The attached thread state for the current thread. */ | ||||
| _Py_thread_local PyThreadState *_Py_tss_tstate = NULL; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Peter Bierma
						Peter Bierma