A helper class for numeric sysvars which can be read in thread-safe way.
More...
#include <ut0atomic_sysvar.h>
|
| struct | Data |
| | Contains all members of Atomic_sysvar<T> in a standard layout struct - which, among other things, means we can't mix private with public, use virtual methods, nor std::function<>. More...
|
| |
|
| | Atomic_sysvar (void(*after_change)()) |
| | Constructs the atomic sysvar, initializes its value to zero and makes sure innodb_init_params() will remember to copy the nonatomic value to atomic value once Server layer finishes modifying the nonatomic value during its initialization. More...
|
| |
| T | load () const |
| | Get the current value of the sys-var without UB. More...
|
| |
| T & | registrable () |
| | Get the variable which we want to register via plugin API. More...
|
| |
|
| static void | update (THD *, SYS_VAR *, void *target, const void *new_value) |
| | This is on-update handler registered via plugin API for all sysvars of this type. More...
|
| |
template<typename
T>
class Atomic_sysvar< T >
A helper class for numeric sysvars which can be read in thread-safe way.
◆ Atomic_sysvar()
Constructs the atomic sysvar, initializes its value to zero and makes sure innodb_init_params() will remember to copy the nonatomic value to atomic value once Server layer finishes modifying the nonatomic value during its initialization.
- Parameters
-
| [in] | after_change | A callback to be called after value changed due to SET or recovery of value stored with SET PERSIST. |
◆ load()
Get the current value of the sys-var without UB.
◆ registrable()
Get the variable which we want to register via plugin API.
Do not use this method in InnoDB code - use load() instead.
◆ update()
This is on-update handler registered via plugin API for all sysvars of this type.
It is called after new value was validated, but before it was assigned. It is the responsibility of this function to assign new_value to target.
- Parameters
-
| [in] | target | This points to Data::m_nonatomic |
| [in] | new_value | This is the new value to be assigned to the sysvar |
◆ m_data
The documentation for this class was generated from the following file: