mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-30 04:26:45 +03:00 
			
		
		
		
	BUG#20598
Fix race between cleanup and thread kill at server shutdown that would sometimes prevent proper cleanup, leading to Valgrind warnings.
This commit is contained in:
		| @@ -1266,13 +1266,13 @@ void clean_up(bool print_message) | ||||
|           MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); | ||||
|   DBUG_PRINT("quit", ("Error messages freed")); | ||||
|   /* Tell main we are ready */ | ||||
|   logger.cleanup_end(); | ||||
|   (void) pthread_mutex_lock(&LOCK_thread_count); | ||||
|   DBUG_PRINT("quit", ("got thread count lock")); | ||||
|   ready_to_exit=1; | ||||
|   /* do the broadcast inside the lock to ensure that my_end() is not called */ | ||||
|   (void) pthread_cond_broadcast(&COND_thread_count); | ||||
|   (void) pthread_mutex_unlock(&LOCK_thread_count); | ||||
|   logger.cleanup_end(); | ||||
|  | ||||
|   /* | ||||
|     The following lines may never be executed as the main thread may have | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 knielsen@mysql.com
					knielsen@mysql.com