#include <config.h>
#include <fcntl.h>
#include <drizzled/error.h>
#include <drizzled/thr_lock.h>
#include <drizzled/session.h>
#include <drizzled/sql_base.h>
#include <drizzled/lock.h>
#include <drizzled/pthread_globals.h>
#include <drizzled/internal/my_sys.h>
#include <drizzled/refresh_version.h>
#include <drizzled/plugin/storage_engine.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. | |
namespace | drizzled::locking |
Functions | |
static void | drizzled::print_lock_error (int error, const char *) |
static void | drizzled::reset_lock_data_and_free (DrizzleLock **mysql_lock) |
static bool | drizzled::locked_named_table (TableList *table_list) |
static bool | drizzled::must_wait (bool is_not_commit) |
void | drizzled::locking::broadcast_refresh (void) |
Variables | |
static boost::mutex | drizzled::LOCK_global_read_lock |
static boost::condition_variable_any | drizzled::COND_global_read_lock |
static drizzled::error_t | drizzled::thr_lock_errno_to_mysql [] |
volatile uint32_t | drizzled::global_read_lock = 0 |
volatile uint32_t | drizzled::global_read_lock_blocks_commit = 0 |
static volatile uint32_t | drizzled::protect_against_global_read_lock = 0 |
static volatile uint32_t | drizzled::waiting_for_read_lock = 0 |
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:
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.