MySQL 8.0.39
Source Code Documentation
locksys::Shard_naked_latch_guard Class Reference

A RAII helper which latches the mutex protecting given shard during constructor, and unlatches it during destruction. More...

#include <lock0guards.h>

Inheritance diagram for locksys::Shard_naked_latch_guard:
[legend]

Public Member Functions

 Shard_naked_latch_guard (ut::Location location, const table_id_t &table_id)
 
 Shard_naked_latch_guard (ut::Location location, const page_id_t &page_id)
 
 ~Shard_naked_latch_guard ()
 

Private Member Functions

 Shard_naked_latch_guard (ut::Location location, Lock_mutex &shard_mutex)
 
- Private Member Functions inherited from ut::Non_copyable
 Non_copyable (const Non_copyable &)=delete
 
Non_copyableoperator= (const Non_copyable &)=delete
 
 Non_copyable ()=default
 
 ~Non_copyable ()=default
 

Private Attributes

Lock_mutexm_shard_mutex
 The mutex protecting the shard requested in constructor. More...
 

Detailed Description

A RAII helper which latches the mutex protecting given shard during constructor, and unlatches it during destruction.

You quite probably don't want to use this class, which only takes a shard's latch, without acquiring global_latch - which gives no protection from threads which latch only the global_latch exclusively to prevent any activity. You should use it in combination with Global_shared_latch_guard, so that you first obtain an s-latch on the global_latch, or simply use the Shard_latch_guard class which already combines the two for you.

Constructor & Destructor Documentation

◆ Shard_naked_latch_guard() [1/3]

locksys::Shard_naked_latch_guard::Shard_naked_latch_guard ( ut::Location  location,
Lock_mutex shard_mutex 
)
explicitprivate

◆ Shard_naked_latch_guard() [2/3]

locksys::Shard_naked_latch_guard::Shard_naked_latch_guard ( ut::Location  location,
const table_id_t table_id 
)
explicit

◆ Shard_naked_latch_guard() [3/3]

locksys::Shard_naked_latch_guard::Shard_naked_latch_guard ( ut::Location  location,
const page_id_t page_id 
)
explicit

◆ ~Shard_naked_latch_guard()

locksys::Shard_naked_latch_guard::~Shard_naked_latch_guard ( )

Member Data Documentation

◆ m_shard_mutex

Lock_mutex& locksys::Shard_naked_latch_guard::m_shard_mutex
private

The mutex protecting the shard requested in constructor.


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