Commit cd0356a7 authored by Monty's avatar Monty Committed by Sergei Golubchik

MDEV-34077 scripts/mariadb-install-db: Error in my_thread_global_end(): 1 threads didn't exit

followup for 952ab9a5

chery-pick of 814dc467 into 10.5
parent 983e6ca0
...@@ -147,7 +147,7 @@ char *guess_malloc_library(); ...@@ -147,7 +147,7 @@ char *guess_malloc_library();
void sf_report_leaked_memory(my_thread_id id); void sf_report_leaked_memory(my_thread_id id);
int sf_sanity(); int sf_sanity();
extern my_thread_id (*sf_malloc_dbug_id)(void); extern my_thread_id (*sf_malloc_dbug_id)(void);
#define SAFEMALLOC_REPORT_MEMORY(X) sf_report_leaked_memory(X) #define SAFEMALLOC_REPORT_MEMORY(X) if (!sf_leaking_memory) sf_report_leaked_memory(X)
#else #else
#define SAFEMALLOC_REPORT_MEMORY(X) do {} while(0) #define SAFEMALLOC_REPORT_MEMORY(X) do {} while(0)
#endif #endif
......
...@@ -220,7 +220,11 @@ void my_thread_global_end(void) ...@@ -220,7 +220,11 @@ void my_thread_global_end(void)
fprintf(stderr, fprintf(stderr,
"Error in my_thread_global_end(): %d threads didn't exit\n", "Error in my_thread_global_end(): %d threads didn't exit\n",
THR_thread_count); THR_thread_count);
#endif #endif /* HAVE_PTHREAD_KILL */
#ifdef SAFEMALLOC
/* We know we will have memoryleaks, suppress the leak report */
sf_leaking_memory= 1;
#endif /* SAFEMALLOC */
all_threads_killed= 0; all_threads_killed= 0;
break; break;
} }
...@@ -234,9 +238,7 @@ void my_thread_global_end(void) ...@@ -234,9 +238,7 @@ void my_thread_global_end(void)
that could use them. that could use them.
*/ */
if (all_threads_killed) if (all_threads_killed)
{
my_thread_destroy_internal_mutex(); my_thread_destroy_internal_mutex();
}
my_thread_global_init_done= 0; my_thread_global_init_done= 0;
} }
......
...@@ -1927,6 +1927,7 @@ extern "C" void unireg_abort(int exit_code) ...@@ -1927,6 +1927,7 @@ extern "C" void unireg_abort(int exit_code)
wsrep_sst_auth_free(); wsrep_sst_auth_free();
#endif // WITH_WSREP #endif // WITH_WSREP
wait_for_signal_thread_to_end();
clean_up(!opt_abort && (exit_code || !opt_bootstrap)); /* purecov: inspected */ clean_up(!opt_abort && (exit_code || !opt_bootstrap)); /* purecov: inspected */
DBUG_PRINT("quit",("done with cleanup in unireg_abort")); DBUG_PRINT("quit",("done with cleanup in unireg_abort"));
mysqld_exit(exit_code); mysqld_exit(exit_code);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment