~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to server-tools/instance-manager/manager.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003-2006 MySQL AB
 
2
 
 
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.
 
6
 
 
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.
 
11
 
 
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
 
17
#define INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
 
18
 
 
19
#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
 
20
#pragma interface
 
21
#endif
 
22
 
 
23
#include <my_global.h>
 
24
 
 
25
class Guardian;
 
26
class Instance_map;
 
27
class Thread_registry;
 
28
class User_map;
 
29
 
 
30
class Manager
 
31
{
 
32
public:
 
33
  static int main();
 
34
 
 
35
  static int flush_instances();
 
36
 
 
37
public:
 
38
  /**
 
39
    These methods return a non-NULL value only for the duration
 
40
    of main().
 
41
  */
 
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; }
 
46
 
 
47
public:
 
48
#ifndef __WIN__
 
49
  static bool is_linux_threads() { return linux_threads; }
 
50
#endif // __WIN__
 
51
 
 
52
private:
 
53
  static void stop_all_threads();
 
54
  static bool init_user_map(User_map *user_map);
 
55
 
 
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;
 
61
 
 
62
#ifndef __WIN__
 
63
  /*
 
64
    This flag is set if Instance Manager is running on the system using
 
65
    LinuxThreads.
 
66
  */
 
67
  static bool linux_threads;
 
68
#endif // __WIN__
 
69
};
 
70
 
 
71
#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H