mirror of
https://github.com/MariaDB/server.git
synced 2026-04-21 07:45:32 +02:00
MDEV-7429 main.mysqldump fails sporadically in buildbot
prevent concurrent cleanups in multi-threaded mysqlimport (they can happen if many threads get an error at the same time), safe_exit() is not thread-safe.
This commit is contained in:
parent
cd0813e33e
commit
121f3e4c90
1 changed files with 6 additions and 1 deletions
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
|
||||
/* Global Thread counter */
|
||||
uint counter;
|
||||
uint counter= 0;
|
||||
pthread_mutex_t counter_mutex;
|
||||
pthread_cond_t count_threshhold;
|
||||
|
||||
|
|
@ -489,6 +489,11 @@ static void safe_exit(int error, MYSQL *mysql)
|
|||
{
|
||||
if (error && ignore_errors)
|
||||
return;
|
||||
|
||||
/* in multi-threaded mode protect from concurrent safe_exit's */
|
||||
if (counter)
|
||||
pthread_mutex_lock(&counter_mutex);
|
||||
|
||||
if (mysql)
|
||||
mysql_close(mysql);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue