diff options
author | unknown <anozdrin@mysql.com> | 2006-05-29 17:26:52 +0400 |
---|---|---|
committer | unknown <anozdrin@mysql.com> | 2006-05-29 17:26:52 +0400 |
commit | 9b7258e1a26a4d89f643902d4f6a761edeb6c782 (patch) | |
tree | d0410bbf001902b9ce47198dfe257c4b28bde460 /server-tools | |
parent | 17dcb6e72ca2a5a25259b4ef828906b617bc8d3e (diff) | |
download | mariadb-git-9b7258e1a26a4d89f643902d4f6a761edeb6c782.tar.gz |
Fix for BUG#19391: IM fails to start after two executions
server-tools/instance-manager/manager.cc:
Start Listener-thread after all initialization.
Diffstat (limited to 'server-tools')
-rw-r--r-- | server-tools/instance-manager/manager.cc | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc index 90d9d04cd36..00ef50a84e1 100644 --- a/server-tools/instance-manager/manager.cc +++ b/server-tools/instance-manager/manager.cc @@ -147,28 +147,6 @@ void manager(const Options &options) if (create_pid_file(options.pid_file_name, manager_pid)) return; - sigset_t mask; - set_signals(&mask); - - /* create the listener */ - { - pthread_t listener_thd_id; - pthread_attr_t listener_thd_attr; - int rc; - - pthread_attr_init(&listener_thd_attr); - pthread_attr_setdetachstate(&listener_thd_attr, PTHREAD_CREATE_DETACHED); - rc= set_stacksize_n_create_thread(&listener_thd_id, &listener_thd_attr, - listener, &listener_args); - pthread_attr_destroy(&listener_thd_attr); - if (rc) - { - log_error("manager(): set_stacksize_n_create_thread(listener) failed"); - goto err; - } - - } - /* create guardian thread */ { pthread_t guardian_thd_id; @@ -211,6 +189,30 @@ void manager(const Options &options) return; } + /* Initialize signals and alarm-infrastructure. */ + + sigset_t mask; + set_signals(&mask); + + /* create the listener */ + { + pthread_t listener_thd_id; + pthread_attr_t listener_thd_attr; + int rc; + + pthread_attr_init(&listener_thd_attr); + pthread_attr_setdetachstate(&listener_thd_attr, PTHREAD_CREATE_DETACHED); + rc= set_stacksize_n_create_thread(&listener_thd_id, &listener_thd_attr, + listener, &listener_args); + pthread_attr_destroy(&listener_thd_attr); + if (rc) + { + log_error("manager(): set_stacksize_n_create_thread(listener) failed"); + goto err; + } + + } + /* After the list of guarded instances have been initialized, Guardian should start them. |