![]() |
MySQL 8.0.40
Source Code Documentation
|
Policy based mutexes. More...
#include "my_inttypes.h"
#include <set>
#include "ib0mutex.h"
#include "os0atomic.h"
#include "sync0policy.h"
#include "ut0mutex.ic"
Go to the source code of this file.
Classes | |
struct | IB_mutex_guard |
class | MutexMonitor |
Iterate over the mutex meta data. More... | |
class | IB_mutex |
Macros | |
#define | UT_MUTEX_TYPE(M, P, T) typedef PolicyMutex<M<P>> T; |
Create a typedef using the MutexType<PolicyType> More... | |
#define | mutex_create(I, M) mutex_init((M), (I), __FILE__, __LINE__) |
#define | mutex_enter(M) mutex_enter_inline(M, UT_LOCATION_HERE) |
#define | mutex_enter_nospin(M) (M)->enter(0, 0, __FILE__, __LINE__) |
#define | mutex_enter_nowait(M) (M)->trylock(__FILE__, __LINE__) |
#define | mutex_exit(M) (M)->exit() |
#define | mutex_free(M) mutex_destroy(M) |
#define | mutex_validate(M) (M)->validate() |
Checks that the mutex has been initialized. More... | |
#define | mutex_own(M) (M)->is_owned() |
Checks that the current thread owns the mutex. More... | |
Typedefs | |
typedef OSMutex | EventMutex |
Functions | |
template<typename Mutex > | |
void | mutex_enter_inline (Mutex *m, ut::Location loc) |
template<typename Mutex > | |
void | mutex_init (Mutex *mutex, latch_id_t id, const char *file_name, uint32_t line) |
Creates, or rather, initializes a mutex object in a specified memory location (which must be appropriately aligned). More... | |
template<typename Mutex > | |
void | mutex_destroy (Mutex *mutex) |
Removes a mutex instance from the mutex list. More... | |
Variables | |
ulong | srv_spin_wait_delay |
ulong | srv_n_spin_wait_rounds |
ulong | srv_force_recovery_crash |
Inject a crash at different steps of the recovery process. More... | |
MutexMonitor * | mutex_monitor |
Defined in sync0sync.cc. More... | |
Policy based mutexes.
Created 2012-03-24 Sunny Bains.
#define mutex_create | ( | I, | |
M | |||
) | mutex_init((M), (I), __FILE__, __LINE__) |
#define mutex_enter | ( | M | ) | mutex_enter_inline(M, UT_LOCATION_HERE) |
#define mutex_free | ( | M | ) | mutex_destroy(M) |
Checks that the current thread owns the mutex.
Works only in the debug version.
#define UT_MUTEX_TYPE | ( | M, | |
P, | |||
T | |||
) | typedef PolicyMutex<M<P>> T; |
Create a typedef using the MutexType<PolicyType>
[in] | M | Mutex type |
[in] | P | Policy type |
[in] | T | The resulting typedef alias |
typedef OSMutex EventMutex |
void mutex_destroy | ( | Mutex * | mutex | ) |
Removes a mutex instance from the mutex list.
The mutex is checked to be in the reset state.
[in,out] | mutex | mutex instance to destroy |
void mutex_enter_inline | ( | Mutex * | m, |
ut::Location | loc | ||
) |
void mutex_init | ( | Mutex * | mutex, |
latch_id_t | id, | ||
const char * | file_name, | ||
uint32_t | line | ||
) |
Creates, or rather, initializes a mutex object in a specified memory location (which must be appropriately aligned).
The mutex is initialized in the reset state. Explicit freeing of the mutex with mutex_free is necessary only if the memory block containing it is freed. Add the mutex instance to the global mutex list.
[in,out] | mutex | mutex to initialise |
[in] | id | The mutex ID (Latch ID) |
[in] | file_name | Filename from where it was called |
[in] | line | Line number in filename from where called |
|
extern |
Defined in sync0sync.cc.
Defined in sync0sync.cc.
|
extern |
Inject a crash at different steps of the recovery process.
This is for testing and debugging only.
|
extern |
|
extern |