![]() |
MySQL 26.7.0
Source Code Documentation
|
Represents a lockable module. More...
#include <module.h>
Public Types | |
| enum class | State { off = 0 , on , start , stop } |
| Enum defining possible states of the module. More... | |
| using | Lock_guard = Lock_guard_object< Module > |
Public Member Functions | |
| Module (PSI_mutex_key mutex_key, PSI_rwlock_key rwlock_key) | |
| Constructs the module. More... | |
| virtual | ~Module () override |
| Destructor. More... | |
| void | init_locking () |
| Initializes internal locking. More... | |
| bool | init () override |
| Initializes the module. More... | |
| Lock_guard | rdlock () |
| Acquires a read lock on this object. More... | |
| Lock_guard | wrlock () |
| Acquires a write lock on this object. More... | |
| bool | deinit () override |
| Deinitializes the module. More... | |
| bool | is_inited () |
| Checks if the module is initialized. More... | |
Public Member Functions inherited from mysql::csa::Initable | |
| virtual | ~Initable ()=default |
| Destructor. More... | |
Protected Member Functions | |
| void | unlock () |
| Unlocks this module. More... | |
| virtual bool | do_init () |
| Initialization hook for derived classes. More... | |
| virtual bool | do_deinit () |
| Deinitialization hook for derived classes. More... | |
Private Attributes | |
| PSI_rwlock_key | m_rwlock_key |
| PSI key for the read-write lock. More... | |
| mysql_rwlock_t | m_rwlock |
| Read-write lock for the module. More... | |
| std::atomic< State > | m_inited {State::off} |
| State of the module. More... | |
Friends | |
| class | Lock_guard_object< Module > |
Represents a lockable module.
|
strong |
| mysql::csa::Module::Module | ( | PSI_mutex_key | mutex_key, |
| PSI_rwlock_key | rwlock_key | ||
| ) |
Constructs the module.
| mutex_key | PSI mutex key |
| rwlock_key | PSI rwlock key |
|
overridevirtual |
Destructor.
|
overridevirtual |
|
protectedvirtual |
Deinitialization hook for derived classes.
Reimplemented in mysql::csa::Csa_service.
|
protectedvirtual |
Initialization hook for derived classes.
Reimplemented in mysql::csa::Csa_service.
|
overridevirtual |
| void mysql::csa::Module::init_locking | ( | ) |
Initializes internal locking.
| bool mysql::csa::Module::is_inited | ( | ) |
Checks if the module is initialized.
| Module::Lock_guard mysql::csa::Module::rdlock | ( | ) |
Acquires a read lock on this object.
|
protected |
Unlocks this module.
| Module::Lock_guard mysql::csa::Module::wrlock | ( | ) |
Acquires a write lock on this object.
|
friend |
|
private |
State of the module.
|
private |
Read-write lock for the module.
|
private |
PSI key for the read-write lock.