MySQL 9.1.0
Source Code Documentation
sync0types.h File Reference

Global types for sync. More...

#include <iostream>
#include <vector>
#include "sync0sync.h"
#include "univ.i"
#include "ut0counter.h"
#include "ut0log.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< LatchCounterlatch_meta_t
 
typedef std::vector< latch_meta_t *, ut::allocator< latch_meta_t * > > LatchMetaData
 
typedef ulint rw_lock_flags_t
 

Enumerations

enum  latch_level_t {
  SYNC_UNKNOWN = 0 , SYNC_MUTEX = 1 , RW_LOCK_SX , RW_LOCK_X_WAIT ,
  RW_LOCK_S , RW_LOCK_X , RW_LOCK_NOT_LOCKED , SYNC_LOCK_FREE_HASH ,
  SYNC_MONITOR_MUTEX , SYNC_ANY_LATCH , SYNC_ALTER_STAGE , SYNC_FIL_SHARD ,
  SYNC_PAGE_ARCH_OPER , SYNC_BUF_FLUSH_LIST , SYNC_BUF_FLUSH_STATE , SYNC_BUF_ZIP_HASH ,
  SYNC_BUF_FREE_LIST , SYNC_BUF_ZIP_FREE , SYNC_BUF_BLOCK , SYNC_BUF_PAGE_HASH ,
  SYNC_BUF_LRU_LIST , SYNC_BUF_CHUNKS , SYNC_DBLWR , SYNC_SEARCH_SYS ,
  SYNC_WORK_QUEUE , SYNC_FTS_TOKENIZE , SYNC_FTS_OPTIMIZE , SYNC_FTS_BG_THREADS ,
  SYNC_FTS_CACHE_INIT , SYNC_RECV , SYNC_LOG_LIMITS , SYNC_LOG_FLUSHER ,
  SYNC_LOG_FILES , SYNC_LOG_WRITER , SYNC_LOG_WRITE_NOTIFIER , SYNC_LOG_FLUSH_NOTIFIER ,
  SYNC_LOG_CLOSER , SYNC_LOG_CHECKPOINTER , SYNC_LOG_SN , SYNC_LOG_SN_MUTEX ,
  SYNC_LOG_GOVERNOR_MUTEX , SYNC_PAGE_ARCH , SYNC_PAGE_ARCH_CLIENT , SYNC_LOG_ARCH ,
  SYNC_PAGE_CLEANER , SYNC_TRX_SYS_HEADER , SYNC_TRX_SYS_SERIALISATION , SYNC_PURGE_QUEUE ,
  SYNC_THREADS , SYNC_TRX , SYNC_POOL , SYNC_POOL_MANAGER ,
  SYNC_TRX_SYS_SHARD , SYNC_TRX_SYS , SYNC_LOCK_SYS_SHARDED , SYNC_LOCK_SYS_GLOBAL ,
  SYNC_LOCK_WAIT_SYS , SYNC_INDEX_ONLINE_LOG , SYNC_IBUF_BITMAP , SYNC_IBUF_BITMAP_MUTEX ,
  SYNC_IBUF_TREE_NODE , SYNC_IBUF_TREE_NODE_NEW , SYNC_IBUF_INDEX_TREE , SYNC_IBUF_MUTEX ,
  SYNC_FSP_PAGE , SYNC_FSP , SYNC_TEMP_POOL_MANAGER , SYNC_EXTERN_STORAGE ,
  SYNC_RSEG_ARRAY_HEADER , SYNC_TRX_UNDO_PAGE , SYNC_RSEG_HEADER , SYNC_RSEG_HEADER_NEW ,
  SYNC_TEMP_SPACE_RSEG , SYNC_UNDO_SPACE_RSEG , SYNC_TRX_SYS_RSEG , SYNC_TRX_UNDO ,
  SYNC_PURGE_LATCH , SYNC_TREE_NODE , SYNC_TREE_NODE_FROM_HASH , SYNC_TREE_NODE_NEW ,
  SYNC_INDEX_TREE , SYNC_RSEGS , SYNC_UNDO_SPACES , SYNC_PERSIST_DIRTY_TABLES ,
  SYNC_PERSIST_AUTOINC , SYNC_IBUF_PESS_INSERT_MUTEX , SYNC_IBUF_HEADER , SYNC_DICT_HEADER ,
  SYNC_TABLE , SYNC_STATS_AUTO_RECALC , SYNC_DICT_AUTOINC_MUTEX , SYNC_DICT ,
  SYNC_PARSER , SYNC_FTS_CACHE , SYNC_UNDO_DDL , SYNC_DICT_OPERATION ,
  SYNC_AHI_ENABLED , SYNC_TRX_I_S_LAST_READ , SYNC_TRX_I_S_RWLOCK , SYNC_RECV_WRITER ,
  SYNC_LEVEL_VARYING , SYNC_NO_ORDER_CHECK , SYNC_LEVEL_MAX = SYNC_NO_ORDER_CHECK
}
 Latching order levels. More...
 
enum  latch_id_t {
  LATCH_ID_NONE = 0 , LATCH_ID_AHI_ENABLED , LATCH_ID_ALTER_STAGE , LATCH_ID_AUTOINC ,
  LATCH_ID_BUF_BLOCK_MUTEX , LATCH_ID_BUF_POOL_CHUNKS , LATCH_ID_BUF_POOL_ZIP , LATCH_ID_BUF_POOL_LRU_LIST ,
  LATCH_ID_BUF_POOL_FREE_LIST , LATCH_ID_BUF_POOL_ZIP_FREE , LATCH_ID_BUF_POOL_ZIP_HASH , LATCH_ID_BUF_POOL_FLUSH_STATE ,
  LATCH_ID_DBLWR , LATCH_ID_DBLWR_SPACE_CACHE , LATCH_ID_DDL_AUTOINC , LATCH_ID_CACHE_LAST_READ ,
  LATCH_ID_DICT_FOREIGN_ERR , LATCH_ID_DICT_SYS , LATCH_ID_DICT_TABLE , LATCH_ID_FIL_SHARD ,
  LATCH_ID_FLUSH_LIST , LATCH_ID_FTS_BG_THREADS , LATCH_ID_FTS_DELETE , LATCH_ID_FTS_OPTIMIZE ,
  LATCH_ID_FTS_DOC_ID , LATCH_ID_FTS_PLL_TOKENIZE , LATCH_ID_HASH_TABLE_MUTEX , LATCH_ID_IBUF_BITMAP ,
  LATCH_ID_IBUF , LATCH_ID_IBUF_PESSIMISTIC_INSERT , LATCH_ID_LOCK_FREE_HASH , LATCH_ID_LOCK_SYS_GLOBAL ,
  LATCH_ID_LOCK_SYS_PAGE , LATCH_ID_LOCK_SYS_TABLE , LATCH_ID_LOCK_SYS_WAIT , LATCH_ID_LOG_SN ,
  LATCH_ID_LOG_SN_MUTEX , LATCH_ID_LOG_CHECKPOINTER , LATCH_ID_LOG_CLOSER , LATCH_ID_LOG_WRITER ,
  LATCH_ID_LOG_FLUSHER , LATCH_ID_LOG_WRITE_NOTIFIER , LATCH_ID_LOG_FLUSH_NOTIFIER , LATCH_ID_LOG_LIMITS ,
  LATCH_ID_LOG_FILES , LATCH_ID_LOG_GOVERNOR_MUTEX , LATCH_ID_PARSER , LATCH_ID_LOG_ARCH ,
  LATCH_ID_PAGE_ARCH , LATCH_ID_PAGE_ARCH_OPER , LATCH_ID_PAGE_ARCH_CLIENT , LATCH_ID_PERSIST_METADATA_BUFFER ,
  LATCH_ID_DICT_PERSIST_DIRTY_TABLES , LATCH_ID_PERSIST_AUTOINC , LATCH_ID_DICT_PERSIST_CHECKPOINT , LATCH_ID_PAGE_CLEANER ,
  LATCH_ID_PURGE_SYS_PQ , LATCH_ID_RECALC_POOL , LATCH_ID_RECV_SYS , LATCH_ID_RECV_WRITER ,
  LATCH_ID_TEMP_SPACE_RSEG , LATCH_ID_UNDO_SPACE_RSEG , LATCH_ID_TRX_SYS_RSEG , LATCH_ID_RW_LOCK_DEBUG ,
  LATCH_ID_RTR_SSN_MUTEX , LATCH_ID_RTR_ACTIVE_MUTEX , LATCH_ID_RTR_MATCH_MUTEX , LATCH_ID_RTR_PATH_MUTEX ,
  LATCH_ID_RW_LOCK_LIST , LATCH_ID_SRV_INNODB_MONITOR , LATCH_ID_SRV_MISC_TMPFILE , LATCH_ID_SRV_MONITOR_FILE ,
  LATCH_ID_SYNC_THREAD , LATCH_ID_TRX_UNDO , LATCH_ID_TRX_POOL , LATCH_ID_TRX_POOL_MANAGER ,
  LATCH_ID_TEMP_POOL_MANAGER , LATCH_ID_TRX , LATCH_ID_TRX_SYS , LATCH_ID_TRX_SYS_SHARD ,
  LATCH_ID_TRX_SYS_SERIALISATION , LATCH_ID_SRV_SYS , LATCH_ID_SRV_SYS_TASKS , LATCH_ID_PAGE_ZIP_STAT_PER_INDEX ,
  LATCH_ID_EVENT_MANAGER , LATCH_ID_EVENT_MUTEX , LATCH_ID_SYNC_ARRAY_MUTEX , LATCH_ID_ZIP_PAD_MUTEX ,
  LATCH_ID_OS_AIO_READ_MUTEX , LATCH_ID_OS_AIO_WRITE_MUTEX , LATCH_ID_OS_AIO_IBUF_MUTEX , LATCH_ID_ROW_DROP_LIST ,
  LATCH_ID_INDEX_ONLINE_LOG , LATCH_ID_WORK_QUEUE , LATCH_ID_BTR_SEARCH , LATCH_ID_BUF_BLOCK_LOCK ,
  LATCH_ID_BUF_BLOCK_DEBUG , LATCH_ID_DICT_OPERATION , LATCH_ID_CHECKPOINT , LATCH_ID_RSEGS ,
  LATCH_ID_UNDO_SPACES , LATCH_ID_UNDO_DDL , LATCH_ID_FIL_SPACE , LATCH_ID_FTS_CACHE ,
  LATCH_ID_FTS_CACHE_INIT , LATCH_ID_TRX_I_S_CACHE , LATCH_ID_TRX_PURGE , LATCH_ID_IBUF_INDEX_TREE ,
  LATCH_ID_INDEX_TREE , LATCH_ID_DICT_TABLE_STATS , LATCH_ID_HASH_TABLE_RW_LOCK , LATCH_ID_BUF_CHUNK_MAP_LATCH ,
  LATCH_ID_SYNC_DEBUG_MUTEX , LATCH_ID_MASTER_KEY_ID_MUTEX , LATCH_ID_FILE_OPEN , LATCH_ID_CLONE_SYS ,
  LATCH_ID_CLONE_TASK , LATCH_ID_CLONE_SNAPSHOT , LATCH_ID_PARALLEL_READ , LATCH_ID_DBLR ,
  LATCH_ID_REDO_LOG_ARCHIVE_ADMIN_MUTEX , LATCH_ID_REDO_LOG_ARCHIVE_QUEUE_MUTEX , LATCH_ID_TEST_MUTEX , LATCH_ID_MAX = LATCH_ID_TEST_MUTEX
}
 Each latch has an ID. More...
 
enum  rw_lock_flag_t { RW_LOCK_FLAG_S = 1 << 0 , RW_LOCK_FLAG_X = 1 << 1 , RW_LOCK_FLAG_SX = 1 << 2 }
 

Functions

latch_meta_tsync_latch_get_meta (latch_id_t id)
 Get the latch meta-data from the latch ID. More...
 
latch_meta_t::CounterTypesync_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_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...
 

Variables

bool innodb_calling_exit
 Set when InnoDB has invoked exit(). More...
 
LatchMetaData latch_meta
 Note: This is accessed without any mutex protection. More...
 

Detailed Description

Global types for sync.

Created 9/5/1995 Heikki Tuuri

Macro Definition Documentation

◆ LATCH_ADD_MUTEX

#define LATCH_ADD_MUTEX (   id,
  level,
  key 
)
Value:
latch_meta[LATCH_ID_##id] = ut::new_withkey<latch_meta_t>( \
UT_NEW_THIS_FILE_PSI_KEY, LATCH_ID_##id, #id, level, #level, key)
required string key
Definition: replication_asynchronous_connection_failover.proto:60
LatchMetaData latch_meta
Note: This is accessed without any mutex protection.
Definition: sync0debug.cc:1195
#define UT_NEW_THIS_FILE_PSI_KEY
Definition: ut0new.h:566
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:510

Latch element Used for mutexes which have PFS keys defined under UNIV_PFS_MUTEX.

Parameters
[in]idLatch id
[in]levelLatch level
[in]keyPFS key

◆ LATCH_ADD_RWLOCK

#define LATCH_ADD_RWLOCK (   id,
  level,
  key 
)
Value:
latch_meta[LATCH_ID_##id] = ut::new_withkey<latch_meta_t>( \
UT_NEW_THIS_FILE_PSI_KEY, LATCH_ID_##id, #id, level, #level, key)

Latch element.

Used for rwlocks which have PFS keys defined under UNIV_PFS_RWLOCK.

Parameters
[in]idLatch id
[in]levelLatch level
[in]keyPFS key

Typedef Documentation

◆ latch_meta_t

◆ LatchMetaData

◆ rw_lock_flags_t

◆ sys_mutex_t

typedef pthread_mutex_t sys_mutex_t

Native mutex.

Enumeration Type Documentation

◆ latch_id_t

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

Enumerator
LATCH_ID_NONE 
LATCH_ID_AHI_ENABLED 
LATCH_ID_ALTER_STAGE 
LATCH_ID_AUTOINC 
LATCH_ID_BUF_BLOCK_MUTEX 
LATCH_ID_BUF_POOL_CHUNKS 
LATCH_ID_BUF_POOL_ZIP 
LATCH_ID_BUF_POOL_LRU_LIST 
LATCH_ID_BUF_POOL_FREE_LIST 
LATCH_ID_BUF_POOL_ZIP_FREE 
LATCH_ID_BUF_POOL_ZIP_HASH 
LATCH_ID_BUF_POOL_FLUSH_STATE 
LATCH_ID_DBLWR 
LATCH_ID_DBLWR_SPACE_CACHE 
LATCH_ID_DDL_AUTOINC 
LATCH_ID_CACHE_LAST_READ 
LATCH_ID_DICT_FOREIGN_ERR 
LATCH_ID_DICT_SYS 
LATCH_ID_DICT_TABLE 
LATCH_ID_FIL_SHARD 
LATCH_ID_FLUSH_LIST 
LATCH_ID_FTS_BG_THREADS 
LATCH_ID_FTS_DELETE 
LATCH_ID_FTS_OPTIMIZE 
LATCH_ID_FTS_DOC_ID 
LATCH_ID_FTS_PLL_TOKENIZE 
LATCH_ID_HASH_TABLE_MUTEX 
LATCH_ID_IBUF_BITMAP 
LATCH_ID_IBUF 
LATCH_ID_IBUF_PESSIMISTIC_INSERT 
LATCH_ID_LOCK_FREE_HASH 
LATCH_ID_LOCK_SYS_GLOBAL 
LATCH_ID_LOCK_SYS_PAGE 
LATCH_ID_LOCK_SYS_TABLE 
LATCH_ID_LOCK_SYS_WAIT 
LATCH_ID_LOG_SN 
LATCH_ID_LOG_SN_MUTEX 
LATCH_ID_LOG_CHECKPOINTER 
LATCH_ID_LOG_CLOSER 
LATCH_ID_LOG_WRITER 
LATCH_ID_LOG_FLUSHER 
LATCH_ID_LOG_WRITE_NOTIFIER 
LATCH_ID_LOG_FLUSH_NOTIFIER 
LATCH_ID_LOG_LIMITS 
LATCH_ID_LOG_FILES 
LATCH_ID_LOG_GOVERNOR_MUTEX 
LATCH_ID_PARSER 
LATCH_ID_LOG_ARCH 
LATCH_ID_PAGE_ARCH 
LATCH_ID_PAGE_ARCH_OPER 
LATCH_ID_PAGE_ARCH_CLIENT 
LATCH_ID_PERSIST_METADATA_BUFFER 
LATCH_ID_DICT_PERSIST_DIRTY_TABLES 
LATCH_ID_PERSIST_AUTOINC 
LATCH_ID_DICT_PERSIST_CHECKPOINT 
LATCH_ID_PAGE_CLEANER 
LATCH_ID_PURGE_SYS_PQ 
LATCH_ID_RECALC_POOL 
LATCH_ID_RECV_SYS 
LATCH_ID_RECV_WRITER 
LATCH_ID_TEMP_SPACE_RSEG 
LATCH_ID_UNDO_SPACE_RSEG 
LATCH_ID_TRX_SYS_RSEG 
LATCH_ID_RW_LOCK_DEBUG 
LATCH_ID_RTR_SSN_MUTEX 
LATCH_ID_RTR_ACTIVE_MUTEX 
LATCH_ID_RTR_MATCH_MUTEX 
LATCH_ID_RTR_PATH_MUTEX 
LATCH_ID_RW_LOCK_LIST 
LATCH_ID_SRV_INNODB_MONITOR 
LATCH_ID_SRV_MISC_TMPFILE 
LATCH_ID_SRV_MONITOR_FILE 
LATCH_ID_SYNC_THREAD 
LATCH_ID_TRX_UNDO 
LATCH_ID_TRX_POOL 
LATCH_ID_TRX_POOL_MANAGER 
LATCH_ID_TEMP_POOL_MANAGER 
LATCH_ID_TRX 
LATCH_ID_TRX_SYS 
LATCH_ID_TRX_SYS_SHARD 
LATCH_ID_TRX_SYS_SERIALISATION 
LATCH_ID_SRV_SYS 
LATCH_ID_SRV_SYS_TASKS 
LATCH_ID_PAGE_ZIP_STAT_PER_INDEX 
LATCH_ID_EVENT_MANAGER 
LATCH_ID_EVENT_MUTEX 
LATCH_ID_SYNC_ARRAY_MUTEX 
LATCH_ID_ZIP_PAD_MUTEX 
LATCH_ID_OS_AIO_READ_MUTEX 
LATCH_ID_OS_AIO_WRITE_MUTEX 
LATCH_ID_OS_AIO_IBUF_MUTEX 
LATCH_ID_ROW_DROP_LIST 
LATCH_ID_INDEX_ONLINE_LOG 
LATCH_ID_WORK_QUEUE 
LATCH_ID_BTR_SEARCH 
LATCH_ID_BUF_BLOCK_LOCK 
LATCH_ID_BUF_BLOCK_DEBUG 
LATCH_ID_DICT_OPERATION 
LATCH_ID_CHECKPOINT 
LATCH_ID_RSEGS 
LATCH_ID_UNDO_SPACES 
LATCH_ID_UNDO_DDL 
LATCH_ID_FIL_SPACE 
LATCH_ID_FTS_CACHE 
LATCH_ID_FTS_CACHE_INIT 
LATCH_ID_TRX_I_S_CACHE 
LATCH_ID_TRX_PURGE 
LATCH_ID_IBUF_INDEX_TREE 
LATCH_ID_INDEX_TREE 
LATCH_ID_DICT_TABLE_STATS 
LATCH_ID_HASH_TABLE_RW_LOCK 
LATCH_ID_BUF_CHUNK_MAP_LATCH 
LATCH_ID_SYNC_DEBUG_MUTEX 
LATCH_ID_MASTER_KEY_ID_MUTEX 
LATCH_ID_FILE_OPEN 
LATCH_ID_CLONE_SYS 
LATCH_ID_CLONE_TASK 
LATCH_ID_CLONE_SNAPSHOT 
LATCH_ID_PARALLEL_READ 
LATCH_ID_DBLR 
LATCH_ID_REDO_LOG_ARCHIVE_ADMIN_MUTEX 
LATCH_ID_REDO_LOG_ARCHIVE_QUEUE_MUTEX 
LATCH_ID_TEST_MUTEX 
LATCH_ID_MAX 

◆ latch_level_t

Latching order levels.

If you modify these, you have to also update LatchDebug internals in sync0debug.cc

Enumerator
SYNC_UNKNOWN 
SYNC_MUTEX 
RW_LOCK_SX 
RW_LOCK_X_WAIT 
RW_LOCK_S 
RW_LOCK_X 
RW_LOCK_NOT_LOCKED 
SYNC_LOCK_FREE_HASH 
SYNC_MONITOR_MUTEX 
SYNC_ANY_LATCH 
SYNC_ALTER_STAGE 
SYNC_FIL_SHARD 
SYNC_PAGE_ARCH_OPER 
SYNC_BUF_FLUSH_LIST 
SYNC_BUF_FLUSH_STATE 
SYNC_BUF_ZIP_HASH 
SYNC_BUF_FREE_LIST 
SYNC_BUF_ZIP_FREE 
SYNC_BUF_BLOCK 
SYNC_BUF_PAGE_HASH 
SYNC_BUF_LRU_LIST 
SYNC_BUF_CHUNKS 
SYNC_DBLWR 
SYNC_SEARCH_SYS 
SYNC_WORK_QUEUE 
SYNC_FTS_TOKENIZE 
SYNC_FTS_OPTIMIZE 
SYNC_FTS_BG_THREADS 
SYNC_FTS_CACHE_INIT 
SYNC_RECV 
SYNC_LOG_LIMITS 
SYNC_LOG_FLUSHER 
SYNC_LOG_FILES 
SYNC_LOG_WRITER 
SYNC_LOG_WRITE_NOTIFIER 
SYNC_LOG_FLUSH_NOTIFIER 
SYNC_LOG_CLOSER 
SYNC_LOG_CHECKPOINTER 
SYNC_LOG_SN 
SYNC_LOG_SN_MUTEX 
SYNC_LOG_GOVERNOR_MUTEX 
SYNC_PAGE_ARCH 
SYNC_PAGE_ARCH_CLIENT 
SYNC_LOG_ARCH 
SYNC_PAGE_CLEANER 
SYNC_TRX_SYS_HEADER 
SYNC_TRX_SYS_SERIALISATION 
SYNC_PURGE_QUEUE 
SYNC_THREADS 
SYNC_TRX 
SYNC_POOL 
SYNC_POOL_MANAGER 
SYNC_TRX_SYS_SHARD 
SYNC_TRX_SYS 
SYNC_LOCK_SYS_SHARDED 
SYNC_LOCK_SYS_GLOBAL 
SYNC_LOCK_WAIT_SYS 
SYNC_INDEX_ONLINE_LOG 
SYNC_IBUF_BITMAP 
SYNC_IBUF_BITMAP_MUTEX 
SYNC_IBUF_TREE_NODE 
SYNC_IBUF_TREE_NODE_NEW 
SYNC_IBUF_INDEX_TREE 
SYNC_IBUF_MUTEX 
SYNC_FSP_PAGE 
SYNC_FSP 
SYNC_TEMP_POOL_MANAGER 
SYNC_EXTERN_STORAGE 
SYNC_RSEG_ARRAY_HEADER 
SYNC_TRX_UNDO_PAGE 
SYNC_RSEG_HEADER 
SYNC_RSEG_HEADER_NEW 
SYNC_TEMP_SPACE_RSEG 
SYNC_UNDO_SPACE_RSEG 
SYNC_TRX_SYS_RSEG 
SYNC_TRX_UNDO 
SYNC_PURGE_LATCH 
SYNC_TREE_NODE 
SYNC_TREE_NODE_FROM_HASH 
SYNC_TREE_NODE_NEW 
SYNC_INDEX_TREE 
SYNC_RSEGS 
SYNC_UNDO_SPACES 
SYNC_PERSIST_DIRTY_TABLES 
SYNC_PERSIST_AUTOINC 
SYNC_IBUF_PESS_INSERT_MUTEX 
SYNC_IBUF_HEADER 
SYNC_DICT_HEADER 
SYNC_TABLE 
SYNC_STATS_AUTO_RECALC 
SYNC_DICT_AUTOINC_MUTEX 
SYNC_DICT 
SYNC_PARSER 
SYNC_FTS_CACHE 
SYNC_UNDO_DDL 
SYNC_DICT_OPERATION 
SYNC_AHI_ENABLED 
SYNC_TRX_I_S_LAST_READ 
SYNC_TRX_I_S_RWLOCK 
SYNC_RECV_WRITER 
SYNC_LEVEL_VARYING 

Level is varying.

Only used with buffer pool page locks, which do not have a fixed level, but instead have their level set after the page is locked; see e.g. ibuf_bitmap_get_map_page().

SYNC_NO_ORDER_CHECK 

This can be used to suppress order checking.

SYNC_LEVEL_MAX 

Maximum level value.

◆ rw_lock_flag_t

Enumerator
RW_LOCK_FLAG_S 
RW_LOCK_FLAG_X 
RW_LOCK_FLAG_SX 

Function Documentation

◆ sync_basename()

const char * sync_basename ( const char *  filename)

Print the filename "basename".

Returns
the basename

Print the filename "basename".

Parameters
[in]filenameName from where to extract the basename
Returns
the basename

◆ sync_file_created_deregister()

void sync_file_created_deregister ( const void *  ptr)

Deregister a latch, called when it is destroyed.

Parameters
[in]ptrLatch to be destroyed

◆ sync_file_created_get()

std::string sync_file_created_get ( const void *  ptr)

Get the string where the file was created.

Its format is "name:line"

Parameters
[in]ptrLatch instance
Returns
created information or "" if can't be found

◆ sync_file_created_register()

void sync_file_created_register ( const void *  ptr,
const char *  filename,
uint16_t  line 
)

Register a latch, called when it is created.

Parameters
[in]ptrLatch instance that was created
[in]filenameFilename where it was created
[in]lineLine number in filename

◆ sync_latch_get_counter()

latch_meta_t::CounterType * sync_latch_get_counter ( latch_id_t  id)
inline

Fetch the counter for the latch.

Parameters
[in]idLatch ID
Returns
the latch counter

◆ sync_latch_get_level()

latch_level_t sync_latch_get_level ( latch_id_t  id)
inline

Get the latch ordering level.

Parameters
[in]idLatch id to lookup
Returns
the latch level

◆ sync_latch_get_meta()

latch_meta_t & sync_latch_get_meta ( latch_id_t  id)
inline

Get the latch meta-data from the latch ID.

Parameters
[in]idLatch ID
Returns
the latch meta data

◆ sync_latch_get_name()

const char * sync_latch_get_name ( latch_id_t  id)
inline

Get the latch name from the latch ID.

Parameters
[in]idLatch ID
Returns
the name, will assert if not found

◆ sync_latch_get_pfs_key()

mysql_pfs_key_t sync_latch_get_pfs_key ( latch_id_t  id)
inline

Get the latch PFS key from the latch ID.

Parameters
[in]idLatch ID
Returns
the PFS key

◆ sync_mutex_to_string()

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.

Parameters
[in]idLatch ID
[in]createdFilename and line number where it was created
Returns
the string representation

Variable Documentation

◆ innodb_calling_exit

bool innodb_calling_exit
extern

Set when InnoDB has invoked exit().

◆ latch_meta

LatchMetaData latch_meta
extern

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()