~drizzle-trunk/drizzle/development

1823.6.1 by Brian Aker
First pass through adding back user_locks.
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2010 Brian Aker
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
21
#include "config.h"
22
#include "plugin/user_locks/module.h"
23
24
using namespace drizzled;
25
26
static int init(drizzled::module::Context &context)
27
{
1933.1.3 by Brian Aker
First pass though barriers.
28
  // We are single threaded at this point, so we can use this to initialize.
29
  user_locks::Locks::getInstance();
1933.1.4 by Brian Aker
Fix errror messages and namespace.
30
  user_locks::barriers::Barriers::getInstance();
1933.1.3 by Brian Aker
First pass though barriers.
31
1933.1.4 by Brian Aker
Fix errror messages and namespace.
32
  context.add(new plugin::Create_function<user_locks::barriers::CreateBarrier>("create_barrier"));
1933.1.3 by Brian Aker
First pass though barriers.
33
  context.add(new plugin::Create_function<user_locks::barriers::Release>("release_barrier"));
34
  context.add(new plugin::Create_function<user_locks::barriers::Wait>("wait"));
1933.1.7 by Brian Aker
Merge in wait_until command.
35
  context.add(new plugin::Create_function<user_locks::barriers::WaitUntil>("wait_until"));
1933.1.3 by Brian Aker
First pass though barriers.
36
  context.add(new plugin::Create_function<user_locks::barriers::Signal>("signal"));
37
1823.6.1 by Brian Aker
First pass through adding back user_locks.
38
  context.add(new plugin::Create_function<user_locks::GetLock>("get_lock"));
1823.6.5 by Brian Aker
Added get_locks() and release_locks();
39
  context.add(new plugin::Create_function<user_locks::GetLocks>("get_locks"));
1823.6.1 by Brian Aker
First pass through adding back user_locks.
40
  context.add(new plugin::Create_function<user_locks::ReleaseLock>("release_lock"));
1823.6.5 by Brian Aker
Added get_locks() and release_locks();
41
  context.add(new plugin::Create_function<user_locks::ReleaseLocks>("release_locks"));
1823.6.1 by Brian Aker
First pass through adding back user_locks.
42
  context.add(new plugin::Create_function<user_locks::IsFreeLock>("is_free_lock"));
43
  context.add(new plugin::Create_function<user_locks::IsUsedLock>("is_used_lock"));
1955.1.1 by Brian Aker
Finally added pieces so that you can do a drop lock and wait.
44
  context.add(new plugin::Create_function<user_locks::locks::WaitFor>("wait_for_lock"));
45
  context.add(new plugin::Create_function<user_locks::locks::ReleaseAndWait>("release_lock_and_wait"));
1823.6.6 by Brian Aker
Added a table function to see locks, updated some tests to see the
46
  context.add(new user_locks::UserLocks);
1933.1.4 by Brian Aker
Fix errror messages and namespace.
47
  context.add(new user_locks::barriers::UserBarriers);
1823.6.1 by Brian Aker
First pass through adding back user_locks.
48
49
  return 0;
50
}
51
52
DRIZZLE_DECLARE_PLUGIN
53
{
54
  DRIZZLE_VERSION_ID,
55
  "User Level Locking Functions",
1933.1.7 by Brian Aker
Merge in wait_until command.
56
  "1.1",
1823.6.1 by Brian Aker
First pass through adding back user_locks.
57
  "Brian Aker",
1933.1.7 by Brian Aker
Merge in wait_until command.
58
  "User level locking and barrier functions",
1823.6.1 by Brian Aker
First pass through adding back user_locks.
59
  PLUGIN_LICENSE_GPL,
60
  init,
61
  NULL,
62
  NULL
63
}
64
DRIZZLE_DECLARE_PLUGIN_END;