45#define mutex_create(I, M) (void)M
46#define mutex_enter(M) (void)M
47#define mutex_enter_nospin(M) (void)M
48#define mutex_enter_nowait(M) (void)M
49#define mutex_exit(M) (void)M
50#define mutex_free(M) (void)M
53#define mutex_validate(M) (M)
55#define mutex_own(m) ((m) != nullptr)
72#define UT_MUTEX_TYPE(M, P, T) typedef PolicyMutex<M<P>> T;
76#ifdef HAVE_IB_LINUX_FUTEX
90typedef FutexMutex ib_mutex_t;
91typedef BlockFutexMutex ib_bpmutex_t;
92#define MUTEX_TYPE "Uses futexes"
93#elif defined(MUTEX_SYS)
94typedef SysMutex ib_mutex_t;
95typedef BlockSysMutex ib_bpmutex_t;
96#define MUTEX_TYPE "Uses system mutexes"
97#elif defined(MUTEX_EVENT)
98typedef SyncArrayMutex ib_mutex_t;
99typedef BlockSyncArrayMutex ib_bpmutex_t;
100#define MUTEX_TYPE "Uses event mutexes"
102#error "ib_mutex_t type is unknown"
110#define mutex_create(I, M) mutex_init((M), (I), __FILE__, __LINE__)
112template <
typename Mutex>
117#define mutex_enter(M) mutex_enter_inline(M, UT_LOCATION_HERE)
119#define mutex_enter_nospin(M) (M)->enter(0, 0, __FILE__, __LINE__)
121#define mutex_enter_nowait(M) (M)->trylock(__FILE__, __LINE__)
123#define mutex_exit(M) (M)->exit()
125#define mutex_free(M) mutex_destroy(M)
160#define mutex_validate(M) (M)->validate()
165#define mutex_own(M) (M)->is_owned()
168#define mutex_validate(M)
171#include "../meb/mutex.h"
172typedef meb::Mutex ib_mutex_t;
173typedef meb::Mutex ib_bpmutex_t;
197 template <
typename Callback>
201 for (LatchMetaData::iterator it =
latch_meta.begin(); it !=
end; ++it) {
204 if (*it ==
nullptr) {
224#ifndef UNIV_HOTBACKUP
235template <
typename Mutex>
247template <
typename Mutex>
255 mutex_create(latch_id,
static_cast<ib_mutex_t *
>(
this));
Track aggregate metrics policy, used by the page mutex.
Definition: sync0policy.h:336
Class that stores callback function reference as well as the result of the callback function call (in...
Definition: keyring_service.cc:43
Definition: ut0mutex.h:252
~IB_mutex()
Definition: ut0mutex.h:257
void unlock()
Definition: ut0mutex.h:261
IB_mutex(latch_id_t latch_id)
Definition: ut0mutex.h:254
void lock(const ut::Location &loc)
Definition: ut0mutex.h:258
Iterate over the mutex meta data.
Definition: ut0mutex.h:177
MutexMonitor()=default
Constructor.
~MutexMonitor()=default
Destructor.
void reset()
Reset the mutex monitoring values.
Definition: sync0sync.cc:274
void disable()
Disable the mutex monitoring.
Definition: sync0sync.cc:260
void enable()
Enable the mutex monitoring.
Definition: sync0sync.cc:246
bool iterate(Callback &callback) const 1
Invoke the callback for each active mutex collection.
Definition: ut0mutex.h:198
#define exit(A)
Definition: lexyy.cc:917
Some integer typedefs for easier portability.
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:94
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
Macros for using atomics.
Collect the metrics per mutex instance, no aggregation.
Definition: sync0policy.h:219
Definition: ut0mutex.h:128
void clear()
Definition: ut0mutex.h:151
~IB_mutex_guard()
Destructor to release mutex.
Definition: ut0mutex.h:139
IB_mutex_guard & operator=(IB_mutex_guard const &)=delete
Disable assignment.
ib_mutex_t * m_mutex
Current mutex for RAII.
Definition: ut0mutex.h:149
IB_mutex_guard(IB_mutex_guard const &)=delete
Disable copy construction.
IB_mutex_guard(ib_mutex_t *in_mutex, const ut::Location &location)
Constructor to acquire mutex.
Definition: ut0mutex.h:133
OS mutex, without any policy.
Definition: sync0types.h:476
OS mutex for tracking lock/unlock for debugging.
Definition: ib0mutex.h:47
Definition: ib0mutex.h:375
const char * filename
Definition: ut0core.h:37
size_t line
Definition: ut0core.h:38
LatchMetaData latch_meta
Note: This is accessed without any mutex protection.
Definition: sync0debug.cc:1195
latch_id_t
Each latch has an ID.
Definition: sync0types.h:345
#define UNIV_NOTHROW
Definition: univ.i:456
ulong srv_force_recovery_crash
Inject a crash at different steps of the recovery process.
Definition: srv0srv.cc:541
ulong srv_spin_wait_delay
Definition: ut0mutex.h:107
MutexMonitor * mutex_monitor
Defined in sync0sync.cc.
Definition: sync0sync.cc:186
OSMutex EventMutex
Definition: ut0mutex.h:74
ulong srv_n_spin_wait_rounds
Definition: ut0mutex.h:108
void mutex_destroy(Mutex *mutex)
Removes a mutex instance from the mutex list.
Definition: ut0mutex.h:248
#define UT_MUTEX_TYPE(M, P, T)
Create a typedef using the MutexType<PolicyType>
Definition: ut0mutex.h:72
#define mutex_exit(M)
Definition: ut0mutex.h:123
#define mutex_free(M)
Definition: ut0mutex.h:125
#define mutex_create(I, M)
Definition: ut0mutex.h:110
void mutex_enter_inline(Mutex *m, ut::Location loc)
Definition: ut0mutex.h:113
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 appropri...
Definition: ut0mutex.h:236
Mutex implementation include file.