mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / server-tools / instance-manager / manager.h
blob49f395a3ad808c25d45dd7580d11cd483b4ce210
1 /* Copyright (c) 2003-2007 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16 #ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
17 #define INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
19 #if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
20 #pragma interface
21 #endif
23 #include <my_global.h>
25 class Guardian;
26 class Instance_map;
27 class Thread_registry;
28 class User_map;
30 class Manager
32 public:
33 static int main();
35 static int flush_instances();
37 public:
38 /**
39 These methods return a non-NULL value only for the duration
40 of main().
42 static Instance_map *get_instance_map() { return p_instance_map; }
43 static Guardian *get_guardian() { return p_guardian; }
44 static Thread_registry *get_thread_registry() { return p_thread_registry; }
45 static User_map *get_user_map() { return p_user_map; }
47 public:
48 #ifndef __WIN__
49 static bool is_linux_threads() { return linux_threads; }
50 #endif // __WIN__
52 private:
53 static void stop_all_threads();
54 static bool init_user_map(User_map *user_map);
56 private:
57 static Guardian *p_guardian;
58 static Instance_map *p_instance_map;
59 static Thread_registry *p_thread_registry;
60 static User_map *p_user_map;
62 #ifndef __WIN__
64 This flag is set if Instance Manager is running on the system using
65 LinuxThreads.
67 static bool linux_threads;
68 #endif // __WIN__
71 #endif // INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H