MySQL 8.0.32
Source Code Documentation
locksys::Shard_latch_guard Class Reference

A RAII wrapper class which combines Global_shared_latch_guard and Shard_naked_latch_guard to s-latch the global lock_sys latch and latch the mutex protecting the specified shard for the duration of its scope. More...

#include <lock0guards.h>

Public Member Functions

 Shard_latch_guard (ut::Location location, const dict_table_t &table)
 
 Shard_latch_guard (ut::Location location, const page_id_t &page_id)
 

Private Attributes

Global_shared_latch_guard m_global_shared_latch_guard
 
Shard_naked_latch_guard m_shard_naked_latch_guard
 

Detailed Description

A RAII wrapper class which combines Global_shared_latch_guard and Shard_naked_latch_guard to s-latch the global lock_sys latch and latch the mutex protecting the specified shard for the duration of its scope.

The order of initialization is important: we have to take shared global latch BEFORE we attempt to use hash function to compute correct shard and latch it.

Constructor & Destructor Documentation

◆ Shard_latch_guard() [1/2]

locksys::Shard_latch_guard::Shard_latch_guard ( ut::Location  location,
const dict_table_t table 
)
inlineexplicit

◆ Shard_latch_guard() [2/2]

locksys::Shard_latch_guard::Shard_latch_guard ( ut::Location  location,
const page_id_t page_id 
)
inlineexplicit

Member Data Documentation

◆ m_global_shared_latch_guard

Global_shared_latch_guard locksys::Shard_latch_guard::m_global_shared_latch_guard
private

◆ m_shard_naked_latch_guard

Shard_naked_latch_guard locksys::Shard_latch_guard::m_shard_naked_latch_guard
private

The documentation for this class was generated from the following file: