My Project
|
00001 /* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; version 2 of the License. 00006 00007 This program is distributed in the hope that it will be useful, 00008 but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 GNU General Public License for more details. 00011 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software 00014 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00015 00016 #ifndef LOCK_INCLUDED 00017 #define LOCK_INCLUDED 00018 00019 #include "thr_lock.h" /* thr_lock_type */ 00020 #include "mdl.h" 00021 00022 // Forward declarations 00023 struct TABLE; 00024 struct TABLE_LIST; 00025 class THD; 00026 typedef struct st_mysql_lock MYSQL_LOCK; 00027 00028 00029 MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count, uint flags); 00030 void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock); 00031 void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock); 00032 void mysql_unlock_some_tables(THD *thd, TABLE **table,uint count); 00033 void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table); 00034 void mysql_lock_abort(THD *thd, TABLE *table, bool upgrade_lock); 00035 bool mysql_lock_abort_for_thread(THD *thd, TABLE *table); 00036 MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b); 00037 /* Lock based on name */ 00038 bool lock_schema_name(THD *thd, const char *db); 00039 /* Lock based on stored routine name */ 00040 bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type, 00041 const char *db, const char *name); 00042 00043 #endif /* LOCK_INCLUDED */