MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hash0hash.cc File Reference
#include "hash0hash.h"
#include "mem0mem.h"
Include dependency graph for hash0hash.cc:

Go to the source code of this file.

Functions

UNIV_INTERN void hash_mutex_enter (hash_table_t *table, ulint fold)
UNIV_INTERN void hash_mutex_exit (hash_table_t *table, ulint fold)
UNIV_INTERN void hash_mutex_enter_all (hash_table_t *table)
UNIV_INTERN void hash_mutex_exit_all (hash_table_t *table)
UNIV_INTERN void hash_mutex_exit_all_but (hash_table_t *table, ib_mutex_t *keep_mutex)
UNIV_INTERN void hash_lock_s (hash_table_t *table, ulint fold)
UNIV_INTERN void hash_lock_x (hash_table_t *table, ulint fold)
UNIV_INTERN void hash_unlock_s (hash_table_t *table, ulint fold)
UNIV_INTERN void hash_unlock_x (hash_table_t *table, ulint fold)
UNIV_INTERN void hash_lock_x_all (hash_table_t *table)
UNIV_INTERN void hash_unlock_x_all (hash_table_t *table)
UNIV_INTERN void hash_unlock_x_all_but (hash_table_t *table, rw_lock_t *keep_lock)
UNIV_INTERN hash_table_thash_create (ulint n)
UNIV_INTERN void hash_table_free (hash_table_t *table)
UNIV_INTERN void hash_create_sync_obj_func (hash_table_t *table, enum hash_table_sync_t type, ulint n_sync_obj)

Detailed Description

The simple hash table utility

Created 5/20/1997 Heikki Tuuri

Definition in file hash0hash.cc.

Function Documentation

UNIV_INTERN hash_table_t* hash_create ( ulint  n)

Creates a hash table with >= n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n.

Returns
own: created table
Parameters
nin: number of array cells

Definition at line 293 of file hash0hash.cc.

Here is the call graph for this function:

UNIV_INTERN void hash_create_sync_obj_func ( hash_table_t table,
enum hash_table_sync_t  type,
ulint  n_sync_obj 
)

Creates a sync object array to protect a hash table. ::sync_obj can be mutexes or rw_locks depening on the type of hash table.

Parameters
tablein: hash table
typein: HASH_TABLE_SYNC_MUTEX or HASH_TABLE_SYNC_RW_LOCK
n_sync_objin: number of sync objects, must be a power of 2

Definition at line 352 of file hash0hash.cc.

UNIV_INTERN void hash_lock_s ( hash_table_t table,
ulint  fold 
)

s-lock a lock for a fold value in a hash table.

Parameters
tablein: hash table
foldin: fold

Definition at line 129 of file hash0hash.cc.

Here is the call graph for this function:

UNIV_INTERN void hash_lock_x ( hash_table_t table,
ulint  fold 
)

x-lock a lock for a fold value in a hash table.

Parameters
tablein: hash table
foldin: fold

Definition at line 152 of file hash0hash.cc.

Here is the call graph for this function:

UNIV_INTERN void hash_lock_x_all ( hash_table_t table)

Reserves all the locks of a hash table, in an ascending order.

Parameters
tablein: hash table

Definition at line 219 of file hash0hash.cc.

Here is the caller graph for this function:

UNIV_INTERN void hash_mutex_enter ( hash_table_t table,
ulint  fold 
)

Reserves the mutex for a fold value in a hash table.

Parameters
tablein: hash table
foldin: fold

Definition at line 46 of file hash0hash.cc.

Here is the call graph for this function:

UNIV_INTERN void hash_mutex_enter_all ( hash_table_t table)

Reserves all the mutexes of a hash table, in an ascending order.

Parameters
tablein: hash table

Definition at line 72 of file hash0hash.cc.

UNIV_INTERN void hash_mutex_exit ( hash_table_t table,
ulint  fold 
)

Releases the mutex for a fold value in a hash table.

Parameters
tablein: hash table
foldin: fold

Definition at line 59 of file hash0hash.cc.

Here is the call graph for this function:

UNIV_INTERN void hash_mutex_exit_all ( hash_table_t table)

Releases all the mutexes of a hash table.

Parameters
tablein: hash table

Definition at line 89 of file hash0hash.cc.

UNIV_INTERN void hash_mutex_exit_all_but ( hash_table_t table,
ib_mutex_t keep_mutex 
)

Releases all but the passed in mutex of a hash table.

Parameters
tablein: hash table
keep_mutexin: mutex to keep

Definition at line 106 of file hash0hash.cc.

UNIV_INTERN void hash_table_free ( hash_table_t table)

Frees a hash table.

Parameters
tablein, own: hash table

Definition at line 334 of file hash0hash.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN void hash_unlock_s ( hash_table_t table,
ulint  fold 
)

unlock an s-lock for a fold value in a hash table.

Parameters
tablein: hash table
foldin: fold

Definition at line 175 of file hash0hash.cc.

Here is the call graph for this function:

UNIV_INTERN void hash_unlock_x ( hash_table_t table,
ulint  fold 
)

unlock x-lock for a fold value in a hash table.

Parameters
tablein: hash table
foldin: fold

Definition at line 198 of file hash0hash.cc.

Here is the call graph for this function:

UNIV_INTERN void hash_unlock_x_all ( hash_table_t table)

Releases all the locks of a hash table, in an ascending order.

Parameters
tablein: hash table

Definition at line 242 of file hash0hash.cc.

UNIV_INTERN void hash_unlock_x_all_but ( hash_table_t table,
rw_lock_t keep_lock 
)

Releases all but passed in lock of a hash table,

Parameters
tablein: hash table
keep_lockin: lock to keep

Definition at line 264 of file hash0hash.cc.

Here is the caller graph for this function: