Commit 4da80772 authored by unknown's avatar unknown

Polishing + make the code compiled on Windows.


server-tools/instance-manager/listener.cc:
  Polishing: declare variable prior to the first statement in block.
server-tools/instance-manager/listener.h:
  Polishing.
server-tools/instance-manager/manager.cc:
  Make Manager::manager_pid local variable.
server-tools/instance-manager/manager.h:
  Make Manager::manager_pid local variable.
server-tools/instance-manager/thread_registry.cc:
  Polsihing.
parent bc06af9d
......@@ -82,12 +82,12 @@ void Listener::run()
{
int i, n= 0;
log_info("Listener: started.");
#ifndef __WIN__
struct sockaddr_un unix_socket_address;
#endif
log_info("Listener: started.");
thread_registry->register_thread(&thread_info);
FD_ZERO(&read_fds);
......
......@@ -34,18 +34,25 @@ class Listener: public Thread
{
public:
Listener(Thread_registry *thread_registry_arg, User_map *user_map_arg);
protected:
virtual void run();
private:
static const int LISTEN_BACK_LOG_SIZE= 5; /* standard backlog size */
private:
Thread_info thread_info;
Thread_registry *thread_registry;
User_map *user_map;
static const int LISTEN_BACK_LOG_SIZE= 5; /* standard backlog size */
ulong total_connection_count;
int sockets[2];
int num_sockets;
fd_set read_fds;
private:
void handle_new_mysql_connection(struct st_vio *vio);
int create_tcp_socket();
int create_unix_socket(struct sockaddr_un &unix_socket_address);
......
......@@ -114,7 +114,6 @@ Guardian *Manager::p_guardian;
Instance_map *Manager::p_instance_map;
Thread_registry *Manager::p_thread_registry;
User_map *Manager::p_user_map;
pid_t Manager::manager_pid;
/*
manager - entry point to the main instance manager process: start
......@@ -131,6 +130,7 @@ int Manager::main()
int rc= 1;
const char *err_msg;
bool shutdown_complete= FALSE;
pid_t manager_pid= getpid();
Thread_registry thread_registry;
/*
......@@ -146,7 +146,6 @@ int Manager::main()
Listener listener(&thread_registry, &user_map);
manager_pid= getpid();
p_instance_map= &instance_map;
p_guardian= instance_map.guardian= &guardian;
p_thread_registry= &thread_registry;
......
......@@ -38,12 +38,11 @@ class Manager
static Guardian *get_guardian() { return p_guardian; }
static Thread_registry *get_thread_registry() { return p_thread_registry; }
static User_map *get_user_map() { return p_user_map; }
static pid_t get_manager_pid() { return manager_pid; }
private:
static void stop_all_threads();
private:
static pid_t manager_pid;
static Guardian *p_guardian;
static Instance_map *p_instance_map;
static Thread_registry *p_thread_registry;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment