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) |
| DrizzleLock * | drizzled::Session::lockTables (Table **tables, uint32_t count, uint32_t flags) |
| int | drizzled::Session::lock_external (Table **tables, uint32_t count) |
| void | drizzled::Session::unlockTables (DrizzleLock *sql_lock) |
| void | drizzled::Session::unlockSomeTables (Table **table, uint32_t count) |
| void | drizzled::Session::unlockReadTables (DrizzleLock *sql_lock) |
| void | drizzled::Session::removeLock (Table *table) |
| void | drizzled::Session::abortLock (Table *table) |
| bool | drizzled::Session::abortLockForThread (Table *table) |
| int | drizzled::Session::unlock_external (Table **table, uint32_t count) |
| DrizzleLock * | drizzled::Session::get_lock_data (Table **table_ptr, uint32_t count, bool should_lock, Table **write_lock_used) |
| int | drizzled::Session::lock_table_name (TableList *table_list) |
| void | drizzled::TableList::unlock_table_name () |
| bool | drizzled::Session::wait_for_locked_table_names (TableList *table_list) |
| bool | drizzled::Session::lock_table_names (TableList *table_list) |
| bool | drizzled::Session::lock_table_names_exclusively (TableList *table_list) |
| void | drizzled::TableList::unlock_table_names (TableList *last_table=NULL) |
| bool | drizzled::Session::lockGlobalReadLock () |
| void | drizzled::Session::unlockGlobalReadLock () |
| bool | drizzled::Session::wait_if_global_read_lock (bool abort_on_refresh, bool is_not_commit) |
| void | drizzled::Session::startWaitingGlobalReadLock () |
| bool | drizzled::Session::makeGlobalReadLockBlockCommit () |
| void | drizzled::locking::broadcast_refresh (void) |
| void drizzled::Session::abortLock | ( | Table * | table | ) |
| bool drizzled::Session::abortLockForThread | ( | Table * | table | ) |
Abort one thread / table combination.
| session | Thread handler |
| table | Table that should be removed from lock queue |
| 0 | Table was not locked by another thread |
| 1 | Table was locked by at least one other thread |
Definition at line 456 of file global.cc.
References drizzled::Table::in_use.
| void drizzled::locking::broadcast_refresh | ( | void | ) |
Broadcast COND_refresh and COND_global_read_lock.
Due to a bug in a threading library it could happen that a signal did not reach its target. A condition for this was that the same condition variable was used with different mutexes in pthread_cond_wait(). Some time ago we changed table::Cache::mutex() to LOCK_global_read_lock in global read lock handling. So COND_refresh was used with table::Cache::mutex() and LOCK_global_read_lock.
We did now also change from COND_refresh to COND_global_read_lock in global read lock handling. But now it is necessary to signal both conditions at the same time.
Definition at line 1109 of file global.cc.
Referenced by drizzled::Session::close_old_data_files(), drizzled::Open_tables_state::close_open_tables(), drizzled::Session::reopen_tables(), drizzled::Session::unlink_open_table(), and drizzled::TableList::unlock_table_names().
|
private |
Get lock structures from table structs and initialize locks.
| session | Thread handler |
| table_ptr | Pointer to tables that should be locks |
| should_lock | One of:
|
| write_lock_used | Store pointer to last table with WRITE_ALLOW_WRITE |
Definition at line 507 of file global.cc.
References drizzled::Table::cursor, drizzled::Table::db_stat, drizzled::Table::lock_count, drizzled::Table::lock_data_start, drizzled::Table::lock_position, drizzled::reset_lock_data_and_free(), and drizzled::Cursor::store_lock().
| int drizzled::Session::lock_table_name | ( | TableList * | table_list | ) |
Put a not open table with an old refresh version in the table cache.
| table_list | Lock first table in this list |
| check_in_use | Do we need to check if table already in use by us |
0 table locked, but someone is using it
Definition at line 619 of file global.cc.
References drizzled::Table::in_use, and drizzled::TableList::table.
| bool drizzled::Session::lock_table_names | ( | TableList * | table_list | ) |
Lock all tables in list with a name lock.
REQUIREMENTS
| table_list | Names of tables to lock |
| 0 | ok |
| 1 | Fatal error (end of memory ?) |
Definition at line 712 of file global.cc.
References lock_table(), and drizzled::TableList::unlock_table_names().
| bool drizzled::Session::lock_table_names_exclusively | ( | TableList * | table_list | ) |
Unlock all tables in list with a name lock.
| table_list | Names of tables to lock. |
| TRUE | An error occured. |
| FALSE | Name lock successfully acquired. |
Definition at line 755 of file global.cc.
References drizzled::TableList::next_global.
| void drizzled::Session::removeLock | ( | Table * | table | ) |
Try to find the table in the list of locked tables. In case of success, unlock the table and remove it from this list.
| session | thread context |
| locked | list of locked tables |
| table | the table to unlock |
| always_unlock | specify explicitly if the legacy side effect is desired. |
|
static |
Reset lock type in lock data and free.
| mysql_lock | Lock structures to reset. |
Definition at line 166 of file global.cc.
Referenced by drizzled::Session::get_lock_data().
|
private |
Unlock a set of external.
Definition at line 474 of file global.cc.
References drizzled::Table::current_lock.
| void drizzled::TableList::unlock_table_names | ( | TableList * | last_table = NULL | ) |
Unlock all tables in list with a name lock.
| table_list | Names of tables to unlock |
| last_table | Don't unlock any tables after this one. (default 0, which will unlock all tables) |
| 0 | ok |
| 1 | Fatal error (end of memory ?) |
Definition at line 794 of file global.cc.
References drizzled::locking::broadcast_refresh(), and drizzled::TableList::next_local.
Referenced by drizzled::Session::lock_table_names().
| void drizzled::Session::unlockReadTables | ( | DrizzleLock * | sql_lock | ) |
unlock all tables locked for read.
Definition at line 346 of file global.cc.
References drizzled::Table::lock_count, drizzled::Table::lock_data_start, and drizzled::Table::lock_position.
Referenced by drizzled::Join::join_free().
| void drizzled::Session::unlockSomeTables | ( | Table ** | table, |
| uint32_t | count | ||
| ) |
Unlock some of the tables locked by lockTables.
This will work even if get_lock_data fails (next unlock will free all)
Definition at line 332 of file global.cc.
Referenced by drizzled::Join::optimize().