1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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)
This commit is contained in:
Sergei Golubchik
2021-01-18 18:01:17 +01:00
parent 4a7e62296a
commit 990eb09333
3 changed files with 43 additions and 49 deletions

View File

@ -18,6 +18,6 @@
void start_handle_manager();
void stop_handle_manager();
bool mysql_manager_submit(void (*action)());
bool mysql_manager_submit(void (*action)(void *), void *data);
#endif /* SQL_MANAGER_INCLUDED */