summaryrefslogtreecommitdiff
path: root/server-tools/instance-manager/instance.h
diff options
context:
space:
mode:
Diffstat (limited to 'server-tools/instance-manager/instance.h')
-rw-r--r--server-tools/instance-manager/instance.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/server-tools/instance-manager/instance.h b/server-tools/instance-manager/instance.h
index 6733985116a..c141ff7b30d 100644
--- a/server-tools/instance-manager/instance.h
+++ b/server-tools/instance-manager/instance.h
@@ -25,36 +25,44 @@
#pragma interface
#endif
+class Instance_map;
+
class Instance
{
public:
- Instance(): is_connected(FALSE)
- {}
- ~Instance();
+ Instance();
+ ~Instance();
int init(const char *name);
+ int complete_initialization(Instance_map *instance_map_arg,
+ const char *mysqld_path, int only_instance= 0);
- /* check if the instance is running and set up mysql connection if yes */
bool is_running();
int start();
int stop();
- int cleanup();
+ /* send a signal to the instance */
+ void kill_instance(int signo);
+ int is_crashed();
+ void fork_and_monitor();
public:
+ enum { DEFAULT_SHUTDOWN_DELAY= 35 };
Instance_options options;
- /* connection to the instance */
- MYSQL mysql;
-
private:
/*
Mutex protecting the instance. Currently we use it to avoid the
double start of the instance. This happens when the instance is starting
and we issue the start command once more.
*/
+ int crashed;
pthread_mutex_t LOCK_instance;
- /* Here we store the state of the following connection */
- bool is_connected;
+ /*
+ This condition variable is used to wake threads waiting for instance to
+ stop in Instance::stop()
+ */
+ pthread_cond_t COND_instance_stopped;
+ Instance_map *instance_map;
};
#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_H */