MySQL 9.1.0
Source Code Documentation
Shared_backup_lock_guard Class Reference

MDL_key::BACKUP_LOCK RAII. More...

#include <sql_backup_lock.h>

Public Types

enum class  Lock_result { not_locked = 0 , locked = 1 , oom = 2 }
 There are three possible results while checking if the instance is locked for backup. More...
 

Public Member Functions

 Shared_backup_lock_guard (THD *thd)
 
 Shared_backup_lock_guard (const Shared_backup_lock_guard &o)=delete
 
 Shared_backup_lock_guard (Shared_backup_lock_guard &&o)=default
 
Shared_backup_lock_guardoperator= (const Shared_backup_lock_guard &o)=delete
 
Shared_backup_lock_guardoperator= (Shared_backup_lock_guard &&o)=default
 
 ~Shared_backup_lock_guard ()
 
 operator Lock_result () const
 

Private Member Functions

Shared_backup_lock_guard::Lock_result try_acquire_shared_backup_lock (THD *thd, bool for_trx)
 Try to acquire shared backup lock. More...
 

Private Attributes

Shared_backup_lock_guard::Lock_result m_lock_state
 
THDm_thd
 

Detailed Description

MDL_key::BACKUP_LOCK RAII.

Member Enumeration Documentation

◆ Lock_result

There are three possible results while checking if the instance is locked for backup.

Enumerator
not_locked 
locked 
oom 

Constructor & Destructor Documentation

◆ Shared_backup_lock_guard() [1/3]

Shared_backup_lock_guard::Shared_backup_lock_guard ( THD thd)

◆ Shared_backup_lock_guard() [2/3]

Shared_backup_lock_guard::Shared_backup_lock_guard ( const Shared_backup_lock_guard o)
delete

◆ Shared_backup_lock_guard() [3/3]

Shared_backup_lock_guard::Shared_backup_lock_guard ( Shared_backup_lock_guard &&  o)
default

◆ ~Shared_backup_lock_guard()

Shared_backup_lock_guard::~Shared_backup_lock_guard ( )

Member Function Documentation

◆ operator Lock_result()

Shared_backup_lock_guard::operator Shared_backup_lock_guard::Lock_result ( ) const

◆ operator=() [1/2]

Shared_backup_lock_guard & Shared_backup_lock_guard::operator= ( const Shared_backup_lock_guard o)
delete

◆ operator=() [2/2]

Shared_backup_lock_guard & Shared_backup_lock_guard::operator= ( Shared_backup_lock_guard &&  o)
default

◆ try_acquire_shared_backup_lock()

Shared_backup_lock_guard::Lock_result Shared_backup_lock_guard::try_acquire_shared_backup_lock ( THD thd,
bool  for_trx 
)
private

Try to acquire shared backup lock.

Parameters
[in]thdCurrent thread context
[in]for_trxtrue if MDL duration is MDL_TRANSACTION false if MDL duration is MDL_EXPLICIT
Returns
Operation status.
Return values
Shared_backup_lock_guard::Lock_result::lockedLocked shared BACKUP lock.
Shared_backup_lock_guard::Lock_result::not_lockedCould not lock shared BACKUP lock. Conflicting lock exists.
Shared_backup_lock_guard::Lock_result::oomError. Could not lock shared BACKUP lock.

Member Data Documentation

◆ m_lock_state

Shared_backup_lock_guard::Lock_result Shared_backup_lock_guard::m_lock_state
private

◆ m_thd

THD* Shared_backup_lock_guard::m_thd
private

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