MySQL 8.0.39
Source Code Documentation
hash0hash.cc File Reference

The simple hash table utility. More...

#include "hash0hash.h"
#include "mem0mem.h"
#include "sync0sync.h"
#include "ut0math.h"

Functions

bool hash_lock_has_all_x (const hash_table_t *table)
 Verifies that the current thread holds X-latch on all shards. More...
 
void hash_lock_x_all (hash_table_t *table)
 Reserves all the locks of a hash table, in an ascending order. More...
 
void hash_unlock_x_all (hash_table_t *table)
 Releases all the locks of a hash table, in an ascending order. More...
 
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,. More...
 
void hash_create_sync_obj (hash_table_t *table, latch_id_t id, size_t n_sync_obj)
 Creates a sync object array to protect a hash table. More...
 

Detailed Description

The simple hash table utility.

Created 5/20/1997 Heikki Tuuri

Function Documentation

◆ hash_create_sync_obj()

void hash_create_sync_obj ( hash_table_t table,
latch_id_t  id,
size_t  n_sync_obj 
)

Creates a sync object array to protect a hash table.

Parameters
[in]tablehash table
[in]idlatch ID
[in]n_sync_objnumber of sync objects, must be a power of 2

◆ hash_lock_has_all_x()

bool hash_lock_has_all_x ( const hash_table_t table)

Verifies that the current thread holds X-latch on all shards.

Assumes type==HASH_TABLE_SYNC_RW_LOCK.

Parameters
[in]tablethe table in question
Returns
true iff the current thread holds X-latch on all shards

◆ hash_lock_x_all()

void hash_lock_x_all ( hash_table_t table)

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

in: hash table

Parameters
tablein: hash table

◆ hash_unlock_x_all()

void hash_unlock_x_all ( hash_table_t table)

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

in: hash table

Parameters
tablein: hash table

◆ hash_unlock_x_all_but()

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
[in]tableHash table
[in]keep_lockLock to keep
Parameters
tablein: hash table
keep_lockin: lock to keep