1
0
mirror of https://github.com/MariaDB/server.git synced 2025-10-28 17:15:19 +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:
knielsen@mysql.com
2006-06-21 12:27:24 +02:00
parent 1b7fe10981
commit b70da9a23f

View File

@@ -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