~drizzle-trunk/drizzle/development

806 by Brian Aker
Adding in an example singe thread scheduler
1
/* Copyright (C) 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
1130.3.21 by Monty Taylor
Added missing include guards. Removed server_includes.h from header.
16
#include <drizzled/server_includes.h>
1152.1.5 by Brian Aker
Remove Factory/make scheduler work like everything else.
17
#include <plugin/single_thread/single_thread.h>
971.3.64 by Eric Day
Cleaned up Scheduler plugin, moved more code to the schedular plugins, reworked some functions to be methods in Session, removed some dead code.
18
806 by Brian Aker
Adding in an example singe thread scheduler
19
using namespace std;
971.3.64 by Eric Day
Cleaned up Scheduler plugin, moved more code to the schedular plugins, reworked some functions to be methods in Session, removed some dead code.
20
using namespace drizzled;
806 by Brian Aker
Adding in an example singe thread scheduler
21
1152.1.5 by Brian Aker
Remove Factory/make scheduler work like everything else.
22
23
/* Global's (TBR) */
24
static SingleThreadScheduler *scheduler= NULL;
25
971.1.51 by Monty Taylor
New-style plugin registration now works.
26
1110.1.5 by Monty Taylor
Renamed PluginRegistry to plugin::Registry.
27
static int init(drizzled::plugin::Registry &registry)
806 by Brian Aker
Adding in an example singe thread scheduler
28
{
1152.1.5 by Brian Aker
Remove Factory/make scheduler work like everything else.
29
  scheduler= new SingleThreadScheduler("single_thread");
30
  registry.add(scheduler);
806 by Brian Aker
Adding in an example singe thread scheduler
31
  return 0;
32
}
33
1110.1.5 by Monty Taylor
Renamed PluginRegistry to plugin::Registry.
34
static int deinit(drizzled::plugin::Registry &registry)
806 by Brian Aker
Adding in an example singe thread scheduler
35
{
1152.1.5 by Brian Aker
Remove Factory/make scheduler work like everything else.
36
  registry.remove(scheduler);
37
  delete scheduler;
38
806 by Brian Aker
Adding in an example singe thread scheduler
39
  return 0;
40
}
41
809 by Brian Aker
Refactor of scheduler plugin code to simplify around one structure. Also
42
static struct st_mysql_sys_var* system_variables[]= {
43
  NULL
44
};
45
813.2.1 by Toru Maesaka
Renamed mysql_declare_plugin to drizzle_declare_plugin
46
drizzle_declare_plugin(single_thread)
806 by Brian Aker
Adding in an example singe thread scheduler
47
{
48
  "single_thread",
49
  "0.1",
50
  "Brian Aker",
51
  "Single Thread Scheduler",
52
  PLUGIN_LICENSE_GPL,
53
  init, /* Plugin Init */
54
  deinit, /* Plugin Deinit */
55
  NULL,   /* status variables */
809 by Brian Aker
Refactor of scheduler plugin code to simplify around one structure. Also
56
  system_variables,   /* system variables */
806 by Brian Aker
Adding in an example singe thread scheduler
57
  NULL    /* config options */
58
}
813.2.2 by Toru Maesaka
Renamed mysql_declare_plugin_end to drizzle_declare_plugin_end
59
drizzle_declare_plugin_end;