1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
4
* Copyright (C) 2008 Sun Microsystems
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
71
void setTable(size_t arg)
73
77
void unlock(uint32_t count);
75
DrizzleLock(size_t table_count_arg)
79
DrizzleLock(size_t table_count_arg, size_t lock_count_arg) :
80
table_count(table_count_arg),
81
lock_count(lock_count_arg)
77
table.resize(table_count_arg);
78
lock_count= table_count_arg * 2;
83
table.resize(table_count);
79
84
locks.resize(lock_count);
85
std::vector<Table *> table;
86
std::vector<THR_LOCK_DATA *> locks;
87
std::vector<THR_LOCK_DATA *> copy_of;
90
/* lockTables() and open_table() flags bits */
89
DrizzleLock *mysql_lock_tables(Session *session, Table **table, uint32_t count,
90
uint32_t flags, bool *need_reopen);
91
/* mysql_lock_tables() and open_table() flags bits */
91
92
#define DRIZZLE_LOCK_IGNORE_GLOBAL_READ_LOCK 0x0001
92
93
#define DRIZZLE_LOCK_IGNORE_FLUSH 0x0002
93
94
#define DRIZZLE_LOCK_NOTIFY_IF_NEED_REOPEN 0x0004
94
95
#define DRIZZLE_OPEN_TEMPORARY_ONLY 0x0008
97
void mysql_unlock_tables(Session *session, DrizzleLock *sql_lock);
98
void mysql_unlock_read_tables(Session *session, DrizzleLock *sql_lock);
99
void mysql_unlock_some_tables(Session *session, Table **table, uint32_t count);
100
void mysql_lock_remove(Session *session, Table *table);
101
void mysql_lock_abort(Session *session, Table *table);
102
bool mysql_lock_abort_for_thread(Session *session, Table *table);
103
bool lock_global_read_lock(Session *session);
104
void unlock_global_read_lock(Session *session);
105
bool wait_if_global_read_lock(Session *session, bool abort_on_refresh,
107
void start_waiting_global_read_lock(Session *session);
108
bool make_global_read_lock_block_commit(Session *session);
109
void broadcast_refresh(void);
111
/* Lock based on name */
112
void unlock_table_name(TableList *table_list);
113
void unlock_table_names(TableList *table_list, TableList *last_table);
114
bool lock_table_names_exclusively(Session *session, TableList *table_list);
96
116
} /* namespace drizzled */
98
118
#endif /* DRIZZLED_LOCK_H */