1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix race condition: instance map wasn't locked for the

duration of the whole 'flush instances'. As a consequence,
it was possible to query instance map, while it is in the
inconsistent state. The patch was reworked after review.
This commit is contained in:
petr@mysql.com
2006-02-21 15:57:56 +03:00
parent 0766fb3a53
commit cb5e54e1bd
4 changed files with 85 additions and 39 deletions

View File

@ -63,21 +63,24 @@ public:
void lock();
void unlock();
int init();
/*
Process a given option and assign it to appropricate instance. This is
required for the option handler, passed to my_search_option_files().
*/
int process_one_option(const char *group, const char *option);
Instance_map(const char *default_mysqld_path_arg);
~Instance_map();
/* loads options from config files */
int load();
/* adds instance to internal hash */
int add_instance(Instance *instance);
/* inits instances argv's after all options have been loaded */
int complete_initialization();
public:
const char *mysqld_path;
Guardian_thread *guardian;
private:
/* loads options from config files */
int load();
/* inits instances argv's after all options have been loaded */
int complete_initialization();
private:
enum { START_HASH_SIZE = 16 };
pthread_mutex_t LOCK_instance_map;