Polishing + make the code compiled on Windows.

parent c136e8d5
......@@ -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,21 +34,28 @@ 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;
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);
int create_tcp_socket();
int create_unix_socket(struct sockaddr_un &unix_socket_address);
};
#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_LISTENER_H
......@@ -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 @@ public:
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;
......
......@@ -371,7 +371,7 @@ bool Thread::start_detached()
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
rc= set_stacksize_and_create_thread(&thd_id, &attr,
Thread::thread_func, this);
Thread::thread_func, this);
pthread_attr_destroy(&attr);
return rc != 0;
......
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