#include <config.h>
#include <fcntl.h>
#include <drizzled/error.h>
#include <drizzled/thr_lock.h>
#include <drizzled/session.h>
#include <drizzled/session/times.h>
#include <drizzled/sql_base.h>
#include <drizzled/lock.h>
#include <drizzled/pthread_globals.h>
#include <drizzled/internal/my_sys.h>
#include <drizzled/plugin/storage_engine.h>
#include <drizzled/util/test.h>
#include <drizzled/open_tables_state.h>
#include <drizzled/table/cache.h>
#include <set>
#include <vector>
#include <algorithm>
#include <functional>
#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/condition_variable.hpp>
Go to the source code of this file.
Namespaces | |
namespace | drizzled |
TODO: Rename this file - func.h is stupid. |
Functions | |
static void | drizzled::print_lock_error (int error, const char *) |
static void | drizzled::reset_lock_data_and_free (DrizzleLock *&lock) |
static bool | drizzled::locked_named_table (TableList *table_list) |
static bool | drizzled::must_wait (bool is_not_commit) |
Locking functions for drizzled.
Because of the new concurrent inserts, we must first get external locks before getting internal locks. If we do it in the other order, the status information is not up to date when called from the lock handler.
GENERAL DESCRIPTION OF LOCKING
When not using LOCK TABLES:
When using LOCK TABLES:
For each statement, we will call table_handler->start_stmt(Session) to inform the table handler that we are using the table.
The tables used can only be tables used in LOCK TABLES or a temporary table.
If table_handler->external_lock(session, locktype) fails, we call table_handler->external_lock(session, F_UNLCK) for each table that was locked, excluding one that caused failure. That means handler must cleanup itself in case external_lock() fails.
Definition in file global.cc.