From 990eb09333dcb2147ccffa9633c1b2bd246aea65 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 18 Jan 2021 18:01:17 +0100 Subject: cleanup: fix and generalize handle_manager thread * provide an argument to the callback * don't ignore a callback request if it's already present in the queue * initialize mutex/cond/in_use flag before starting the thread, in case the first callback queueing request arrives before handle_manager had time to initialize * set/check abort_manager under a mutex, otherwise handle_manager thread might destroy LOCK_manager before stop_handle_manager released it * signal COND on queueing a callback, stop cond_wait on callback request * always start the thread, even if flush_time is 0 * but keep the old behavior in embedded (no replication, no galera) * style cleanups (e.g. remove volatile for a variable protected by a mutex) --- libmysqld/lib_sql.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libmysqld/lib_sql.cc') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 229e4e69e6a..ddb3f2c71aa 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -623,7 +623,8 @@ int init_embedded_server(int argc, char **argv, char **groups) (void) thr_setconcurrency(concurrency); // 10 by default - start_handle_manager(); + if (flush_time && flush_time != ~(ulong) 0L) + start_handle_manager(); // FIXME initialize binlog_filter and rpl_filter if not already done // corresponding delete is in clean_up() -- cgit v1.2.1