MySQL 8.0.39
Source Code Documentation
|
Debug checks for latches, header file. More...
Go to the source code of this file.
Classes | |
class | Sync_point |
For handling sync points in child threads spawned by a foreground thread. More... | |
Functions | |
void | sync_check_init (size_t max_threads) |
Initializes the synchronization data structures. More... | |
void | sync_check_close () |
Frees the resources in synchronization data structures. More... | |
void | sync_check_enable () |
Enable sync order checking. More... | |
void | sync_check_lock_validate (const latch_t *latch) |
Check if it is OK to acquire the latch. More... | |
void | sync_check_lock_granted (const latch_t *latch) |
Note that the lock has been granted. More... | |
void | sync_check_lock (const latch_t *latch, latch_level_t level) |
Check if it is OK to acquire the latch. More... | |
void | sync_check_relock (const latch_t *latch) |
Check if it is OK to re-acquire the lock. More... | |
void | sync_check_unlock (const latch_t *latch) |
Removes a latch from the thread level array if it is found there. More... | |
const latch_t * | sync_check_find (latch_level_t level) |
Checks if the level array for the current thread contains a mutex or rw-latch at the specified level. More... | |
bool | sync_check_iterate (sync_check_functor_t &functor) |
Checks that the level array for the current thread is empty. More... | |
void | rw_lock_debug_mutex_enter () |
Acquires the debug mutex. More... | |
void | rw_lock_debug_mutex_exit () |
Releases the debug mutex. More... | |
Debug checks for latches, header file.
Created 2012-08-21 Sunny Bains
void rw_lock_debug_mutex_enter | ( | ) |
Acquires the debug mutex.
We cannot use the mutex defined in sync0sync, because the debug mutex is also acquired in sync0arr while holding the OS mutex protecting the sync array, and the ordinary mutex_enter might recursively call routines in sync0arr, leading to a deadlock on the OS mutex.
void rw_lock_debug_mutex_exit | ( | ) |
Releases the debug mutex.
void sync_check_close | ( | ) |
Frees the resources in synchronization data structures.
Frees the resources in synchronization data structures.
Use os_sync_free() after calling this.
void sync_check_enable | ( | ) |
Enable sync order checking.
Note: We don't enforce any synchronisation checks. The caller must ensure that no races can occur
const latch_t * sync_check_find | ( | latch_level_t | level | ) |
Checks if the level array for the current thread contains a mutex or rw-latch at the specified level.
[in] | level | to find |
void sync_check_init | ( | size_t | max_threads | ) |
Initializes the synchronization data structures.
[in] | max_threads | Maximum threads that can be created. |
For collecting latch statistic - SHOW ... MUTEX
For trcking mutex creation location
bool sync_check_iterate | ( | sync_check_functor_t & | functor | ) |
Checks that the level array for the current thread is empty.
Terminate iteration if the functor returns true.
[in,out] | functor | called for each element. |
void sync_check_lock | ( | const latch_t * | latch, |
latch_level_t | level | ||
) |
Check if it is OK to acquire the latch.
[in] | latch | latch type |
[in] | level | the level of the mutex |
void sync_check_lock_granted | ( | const latch_t * | latch | ) |
Note that the lock has been granted.
[in] | latch | latch type |
void sync_check_lock_validate | ( | const latch_t * | latch | ) |
Check if it is OK to acquire the latch.
[in] | latch | latch type |
void sync_check_relock | ( | const latch_t * | latch | ) |
Check if it is OK to re-acquire the lock.
[in] | latch | RW-LOCK to relock (recursive X locks) |
void sync_check_unlock | ( | const latch_t * | latch | ) |
Removes a latch from the thread level array if it is found there.
[in] | latch | The latch to unlock |