MySQL  8.0.19
Source Code Documentation
Acl_cache_lock_guard Class Reference

Lock guard for ACL Cache. More...

#include <sql_auth_cache.h>

Public Member Functions

 Acl_cache_lock_guard (THD *thd, Acl_cache_lock_mode mode)
 Acl_cache_lock_guard constructor. More...
 ~Acl_cache_lock_guard ()
 Acl_cache_lock_guard destructor. More...
bool lock (bool raise_error=true)
 Explicitly take lock on Acl_cache_lock_cache object. More...
void unlock ()
 Explicitly unlock all acquired locks. More...

Private Member Functions

bool already_locked ()
 Check whether lock is already obtained or not. More...

Private Attributes

 Handle to THD object. More...
Acl_cache_lock_mode m_mode
 Lock mode. More...
bool m_locked
 Lock status. More...

Detailed Description

Lock guard for ACL Cache.

Destructor automatically releases the lock.

Constructor & Destructor Documentation

◆ Acl_cache_lock_guard()

Acl_cache_lock_guard::Acl_cache_lock_guard ( THD thd,
Acl_cache_lock_mode  mode 

Acl_cache_lock_guard constructor.

[in]thdTHD Handle.
[in]modeLock mode

◆ ~Acl_cache_lock_guard()

Acl_cache_lock_guard::~Acl_cache_lock_guard ( )

Acl_cache_lock_guard destructor.

Release lock(s) if taken

Member Function Documentation

◆ already_locked()

bool Acl_cache_lock_guard::already_locked ( )

Check whether lock is already obtained or not.

lock status
Return values
trueLock has already been taken.
falseNo lock is taken with this Acl_cache_lock_guard object

◆ lock()

bool Acl_cache_lock_guard::lock ( bool  raise_error = true)

Explicitly take lock on Acl_cache_lock_cache object.

If cache was already locked, just return.

[in]raise_errorWhether to raise error if we fail to acquire lock
status of lock
Return values
trueLock was acquired/already acquired.
falseThere was some problem acquiring lock.

◆ unlock()

void Acl_cache_lock_guard::unlock ( )

Explicitly unlock all acquired locks.

Member Data Documentation

◆ m_locked

bool Acl_cache_lock_guard::m_locked

Lock status.

◆ m_mode

Acl_cache_lock_mode Acl_cache_lock_guard::m_mode

Lock mode.

◆ m_thd

THD* Acl_cache_lock_guard::m_thd

Handle to THD object.

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