MySQL 8.0.39
Source Code Documentation
|
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 | |
THD * | m_thd |
Handle to THD object. More... | |
Acl_cache_lock_mode | m_mode |
Lock mode. More... | |
bool | m_locked |
Lock status. More... | |
Lock guard for ACL Cache.
Destructor automatically releases the lock.
Acl_cache_lock_guard::Acl_cache_lock_guard | ( | THD * | thd, |
Acl_cache_lock_mode | mode | ||
) |
Acl_cache_lock_guard constructor.
[in] | thd | THD Handle. |
[in] | mode | Lock mode |
|
inline |
Acl_cache_lock_guard destructor.
Release lock(s) if taken
|
private |
Check whether lock is already obtained or not.
true | Lock has already been taken. |
false | No lock is taken with this Acl_cache_lock_guard object |
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_error | Whether to raise error if we fail to acquire lock |
true | Lock was acquired/already acquired. |
false | There was some problem acquiring lock. |
void Acl_cache_lock_guard::unlock | ( | ) |
Explicitly unlock all acquired locks.
|
private |
Lock status.
|
private |
Lock mode.
|
private |
Handle to THD object.