Thread: Clear TLS after thread stop (#1807)
This commit is contained in:
		
							parent
							
								
									76d38e832e
								
							
						
					
					
						commit
						c92217a109
					
				| @ -93,14 +93,16 @@ static void furi_thread_body(void* context) { | |||||||
|             thread->name ? thread->name : "<unknown service>"); |             thread->name ? thread->name : "<unknown service>"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // clear thread local storage
 |     // flush stdout
 | ||||||
|     __furi_thread_stdout_flush(thread); |     __furi_thread_stdout_flush(thread); | ||||||
|     furi_assert(pvTaskGetThreadLocalStoragePointer(NULL, 0) != NULL); |  | ||||||
|     vTaskSetThreadLocalStoragePointer(NULL, 0, NULL); |  | ||||||
| 
 | 
 | ||||||
|     // from here we can't use thread pointer
 |     // from here we can't use thread pointer
 | ||||||
|     furi_thread_set_state(thread, FuriThreadStateStopped); |     furi_thread_set_state(thread, FuriThreadStateStopped); | ||||||
| 
 | 
 | ||||||
|  |     // clear thread local storage
 | ||||||
|  |     furi_assert(pvTaskGetThreadLocalStoragePointer(NULL, 0) != NULL); | ||||||
|  |     vTaskSetThreadLocalStoragePointer(NULL, 0, NULL); | ||||||
|  | 
 | ||||||
|     vTaskDelete(NULL); |     vTaskDelete(NULL); | ||||||
|     furi_thread_catch(); |     furi_thread_catch(); | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Sergey Gavrilov
						Sergey Gavrilov