![]() |
MySQL
8.0.23
Source Code Documentation
|
#include <iostream>
#include <vector>
#include "sync0sync.h"
#include "univ.i"
#include "ut0counter.h"
#include "ut0new.h"
Go to the source code of this file.
Classes | |
struct | OSMutex |
OS mutex, without any policy. More... | |
class | LatchCounter |
Default latch counter. More... | |
struct | LatchCounter::Count |
The counts we collect for a mutex. More... | |
class | LatchMeta< Counter > |
Latch meta data. More... | |
struct | latch_t |
All (ordered) latches, used in debugging, must derive from this class. More... | |
struct | sync_check_functor_t |
Subclass this to iterate over a thread's acquired latch levels. More... | |
struct | btrsea_sync_check |
Functor to check whether the calling thread owns the btr search mutex. More... | |
struct | dict_sync_check |
Functor to check for dictionary latching constraints. More... | |
struct | sync_allowed_latches |
Functor to check for given latching constraints. More... | |
Macros | |
#define | LATCH_ADD_MUTEX(id, level, key) |
Latch element Used for mutexes which have PFS keys defined under UNIV_PFS_MUTEX. More... | |
#define | LATCH_ADD_RWLOCK(id, level, key) |
Latch element. More... | |
Typedefs | |
typedef pthread_mutex_t | sys_mutex_t |
Native mutex. More... | |
typedef LatchMeta< LatchCounter > | latch_meta_t |
typedef std::vector< latch_meta_t *, ut_allocator< latch_meta_t * > > | LatchMetaData |
typedef ulint | rw_lock_flags_t |
Functions | |
latch_meta_t & | sync_latch_get_meta (latch_id_t id) |
Get the latch meta-data from the latch ID. More... | |
latch_meta_t::CounterType * | sync_latch_get_counter (latch_id_t id) |
Fetch the counter for the latch. More... | |
const char * | sync_latch_get_name (latch_id_t id) |
Get the latch name from the latch ID. More... | |
latch_level_t | sync_latch_get_level (latch_id_t id) |
Get the latch ordering level. More... | |
mysql_pfs_key_t | sync_latch_get_pfs_key (latch_id_t id) |
Get the latch PFS key from the latch ID. More... | |
std::string | sync_mutex_to_string (latch_id_t id, const std::string &created) |
String representation of the filename and line number where the latch was created. More... | |
const char * | sync_latch_get_name (latch_level_t level) |
Get the latch name from a sync level. More... | |
const char * | sync_basename (const char *filename) |
Print the filename "basename". More... | |
void | sync_file_created_register (const void *ptr, const char *filename, uint16_t line) |
Register a latch, called when it is created. More... | |
void | sync_file_created_deregister (const void *ptr) |
Deregister a latch, called when it is destroyed. More... | |
std::string | sync_file_created_get (const void *ptr) |
Get the string where the file was created. More... | |
latch_id_t | sync_latch_get_id (const char *name) |
Get the latch id from a latch name. More... | |
Variables | |
bool | innodb_calling_exit |
Set when InnoDB has invoked exit(). More... | |
LatchMetaData | latch_meta |
Note: This is accessed without any mutex protection. More... | |
Global types for sync
Created 9/5/1995 Heikki Tuuri
Latch element Used for mutexes which have PFS keys defined under UNIV_PFS_MUTEX.
[in] | id | Latch id |
[in] | level | Latch level |
[in] | key | PFS key |
Latch element.
Used for rwlocks which have PFS keys defined under UNIV_PFS_RWLOCK.
[in] | id | Latch id |
[in] | level | Latch level |
[in] | key | PFS key |
typedef LatchMeta<LatchCounter> latch_meta_t |
typedef std::vector<latch_meta_t *, ut_allocator<latch_meta_t *> > LatchMetaData |
typedef ulint rw_lock_flags_t |
typedef pthread_mutex_t sys_mutex_t |
Native mutex.
enum latch_id_t |
Each latch has an ID.
This id is used for creating the latch and to look up its meta-data. See sync0debug.c. The order does not matter here, but alphabetical ordering seems useful
enum latch_level_t |
Latching order levels.
If you modify these, you have to also update LatchDebug internals in sync0debug.cc
enum mutex_state_t |
The new (C++11) syntax allows the following and we should use it when it is available on platforms that we support.
enum class mutex_state_t : lock_word_t { ... };
Mutex states.
Enumerator | |
---|---|
MUTEX_STATE_UNLOCKED | Mutex is free. |
MUTEX_STATE_LOCKED | Mutex is acquired by some thread. |
MUTEX_STATE_WAITERS | Mutex is contended and there are threads waiting on the lock. |
enum rw_lock_flag_t |
const char* sync_basename | ( | const char * | filename | ) |
Print the filename "basename".
Print the filename "basename".
[in] | filename | Name from where to extract the basename |
void sync_file_created_deregister | ( | const void * | ptr | ) |
Deregister a latch, called when it is destroyed.
[in] | ptr | Latch to be destroyed |
std::string sync_file_created_get | ( | const void * | ptr | ) |
Get the string where the file was created.
Its format is "name:line"
[in] | ptr | Latch instance |
void sync_file_created_register | ( | const void * | ptr, |
const char * | filename, | ||
uint16_t | line | ||
) |
Register a latch, called when it is created.
[in] | ptr | Latch instance that was created |
[in] | filename | Filename where it was created |
[in] | line | Line number in filename |
|
inline |
Fetch the counter for the latch.
[in] | id | Latch ID |
latch_id_t sync_latch_get_id | ( | const char * | name | ) |
Get the latch id from a latch name.
[in] | name | Latch name |
|
inline |
Get the latch ordering level.
[in] | id | Latch id to lookup |
|
inline |
Get the latch meta-data from the latch ID.
[in] | id | Latch ID |
|
inline |
Get the latch name from the latch ID.
[in] | id | Latch ID |
const char* sync_latch_get_name | ( | latch_level_t | level | ) |
Get the latch name from a sync level.
[in] | level | Latch level to lookup |
|
inline |
Get the latch PFS key from the latch ID.
[in] | id | Latch ID |
std::string sync_mutex_to_string | ( | latch_id_t | id, |
const std::string & | created | ||
) |
String representation of the filename and line number where the latch was created.
[in] | id | Latch ID |
[in] | created | Filename and line number where it was crated |
bool innodb_calling_exit |
Set when InnoDB has invoked exit().
LatchMetaData latch_meta |
Note: This is accessed without any mutex protection.
It is initialised at startup and elements should not be added to or removed from it after that. See sync_latch_meta_init()