MySQL 9.1.0
Source Code Documentation
locksys::Shard_latches_guard Class Reference

A RAII wrapper class which s-latches the global lock_sys shard, and mutexes protecting specified shards for the duration of its scope. More...

#include <lock0guards.h>

Public Member Functions

 Shard_latches_guard (ut::Location location, const buf_block_t &block_a, const buf_block_t &block_b)
 

Private Attributes

Global_shared_latch_guard m_global_shared_latch_guard
 
Shard_naked_latches_guard m_shard_naked_latches_guard
 

Detailed Description

A RAII wrapper class which s-latches the global lock_sys shard, and mutexes protecting specified shards for the duration of its scope.

It makes sure to take the latches in correct order and handles the case where both pages are in the same shard correctly. 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_latches_guard()

locksys::Shard_latches_guard::Shard_latches_guard ( ut::Location  location,
const buf_block_t block_a,
const buf_block_t block_b 
)
inlineexplicit

Member Data Documentation

◆ m_global_shared_latch_guard

Global_shared_latch_guard locksys::Shard_latches_guard::m_global_shared_latch_guard
private

◆ m_shard_naked_latches_guard

Shard_naked_latches_guard locksys::Shard_latches_guard::m_shard_naked_latches_guard
private

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