MySQL 8.3.0
Source Code Documentation
my_init.cc File Reference
#include "my_config.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unordered_map>
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_macros.h"
#include "my_psi_config.h"
#include "my_sys.h"
#include "my_thread.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/psi/mysql_cond.h"
#include "mysql/psi/mysql_file.h"
#include "mysql/psi/mysql_memory.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysql/psi/mysql_rwlock.h"
#include "mysql/psi/mysql_stage.h"
#include "mysql/psi/mysql_thread.h"
#include "mysql/psi/psi_cond.h"
#include "mysql/psi/psi_file.h"
#include "mysql/psi/psi_memory.h"
#include "mysql/psi/psi_mutex.h"
#include "mysql/psi/psi_rwlock.h"
#include "mysql/psi/psi_stage.h"
#include "mysql/psi/psi_thread.h"
#include "mysql/strings/m_ctype.h"
#include "mysys/my_static.h"
#include "mysys/mysys_priv.h"
#include "mysys_err.h"
#include "nulls.h"
#include "str2int.h"
#include "strxmov.h"
#include "template_utils.h"
#include <sys/resource.h>

Macros

#define SCALE_SEC   100
 
#define SCALE_USEC   10000
 

Functions

static ulong atoi_octal (const char *str)
 
bool my_init ()
 Initialize my_sys functions, resources and variables. More...
 
void my_end (int infoflag)
 
void my_abort ()
 Calls our own implementation of abort, if specified, or std's abort(). More...
 
void set_my_abort (void(*new_my_abort_func)())
 Sets a new function to be called on my_abort(). More...
 
void my_init_mysys_psi_keys ()
 

Variables

bool my_init_done = false
 
ulong my_thread_stack_size = 65536
 
static void(* my_abort_func )() = abort
 Pointer to function that handles abort. More...
 
PSI_stage_info stage_waiting_for_table_level_lock
 
PSI_stage_info stage_waiting_for_disk_space
 
PSI_mutex_key key_IO_CACHE_append_buffer_lock
 
PSI_mutex_key key_IO_CACHE_SHARE_mutex
 
PSI_mutex_key key_KEY_CACHE_cache_lock
 
PSI_mutex_key key_THR_LOCK_heap
 
PSI_mutex_key key_THR_LOCK_lock
 
PSI_mutex_key key_THR_LOCK_malloc
 
PSI_mutex_key key_THR_LOCK_mutex
 
PSI_mutex_key key_THR_LOCK_myisam
 
PSI_mutex_key key_THR_LOCK_net
 
PSI_mutex_key key_THR_LOCK_open
 
PSI_mutex_key key_THR_LOCK_threads
 
PSI_mutex_key key_TMPDIR_mutex
 
PSI_mutex_key key_THR_LOCK_myisam_mmap
 
static PSI_mutex_info all_mysys_mutexes []
 
PSI_rwlock_key key_SAFE_HASH_lock
 
static PSI_rwlock_info all_mysys_rwlocks []
 
PSI_cond_key key_IO_CACHE_SHARE_cond
 
PSI_cond_key key_IO_CACHE_SHARE_cond_writer
 
PSI_cond_key key_THR_COND_threads
 
static PSI_cond_info all_mysys_conds []
 
PSI_file_key key_file_proc_meminfo
 
PSI_file_key key_file_charset
 
PSI_file_key key_file_cnf
 
static PSI_file_info all_mysys_files []
 
PSI_stage_infoall_mysys_stages [] = {&stage_waiting_for_table_level_lock}
 
static PSI_memory_info all_mysys_memory []
 
static PSI_thread_info all_mysys_thread []
 

Macro Definition Documentation

◆ SCALE_SEC

#define SCALE_SEC   100

◆ SCALE_USEC

#define SCALE_USEC   10000

Function Documentation

◆ atoi_octal()

static ulong atoi_octal ( const char *  str)
static

◆ my_abort()

void my_abort ( )

Calls our own implementation of abort, if specified, or std's abort().

◆ set_my_abort()

void set_my_abort ( void(*)()  new_my_abort_func)

Sets a new function to be called on my_abort().

Parameters
new_my_abort_funcpointer to a new my_abort function. It can't be [[noreturn]] as pointers to methods can't have attributes.

Variable Documentation

◆ all_mysys_conds

PSI_cond_info all_mysys_conds[]
static
Initial value:
= {
{&key_IO_CACHE_SHARE_cond, "IO_CACHE_SHARE::cond", 0, 0, PSI_DOCUMENT_ME},
{&key_IO_CACHE_SHARE_cond_writer, "IO_CACHE_SHARE::cond_writer", 0, 0,
{&key_THR_COND_threads, "THR_COND_threads", 0, 0, PSI_DOCUMENT_ME}}
#define PSI_DOCUMENT_ME
Definition: component_common.h:28
PSI_cond_key key_IO_CACHE_SHARE_cond
Definition: my_init.cc:498
PSI_cond_key key_THR_COND_threads
Definition: my_init.cc:499
PSI_cond_key key_IO_CACHE_SHARE_cond_writer
Definition: my_init.cc:498

◆ all_mysys_files

PSI_file_info all_mysys_files[]
static
Initial value:
= {
{&key_file_proc_meminfo, "proc_meminfo", 0, 0, PSI_DOCUMENT_ME},
{&key_file_charset, "charset", 0, 0, PSI_DOCUMENT_ME},
{&key_file_cnf, "cnf", 0, 0, PSI_DOCUMENT_ME}}
PSI_file_key key_file_cnf
Definition: my_init.cc:514
PSI_file_key key_file_charset
Definition: my_init.cc:514
PSI_file_key key_file_proc_meminfo
Definition: my_init.cc:512

◆ all_mysys_memory

PSI_memory_info all_mysys_memory[]
static

◆ all_mysys_mutexes

PSI_mutex_info all_mysys_mutexes[]
static
Initial value:
= {
{&key_IO_CACHE_append_buffer_lock, "IO_CACHE::append_buffer_lock", 0, 0,
{&key_IO_CACHE_SHARE_mutex, "IO_CACHE::SHARE_mutex", 0, 0, PSI_DOCUMENT_ME},
{&key_KEY_CACHE_cache_lock, "KEY_CACHE::cache_lock", 0, 0, PSI_DOCUMENT_ME},
{&key_THR_LOCK_heap, "THR_LOCK_heap", PSI_FLAG_SINGLETON, 0,
{&key_THR_LOCK_lock, "THR_LOCK_lock", PSI_FLAG_SINGLETON, 0,
{&key_THR_LOCK_malloc, "THR_LOCK_malloc", PSI_FLAG_SINGLETON, 0,
{&key_THR_LOCK_mutex, "THR_LOCK::mutex", 0, 0, PSI_DOCUMENT_ME},
{&key_THR_LOCK_myisam, "THR_LOCK_myisam", PSI_FLAG_SINGLETON, 0,
{&key_THR_LOCK_open, "THR_LOCK_open", PSI_FLAG_SINGLETON, 0,
{&key_THR_LOCK_threads, "THR_LOCK_threads", PSI_FLAG_SINGLETON, 0,
{&key_THR_LOCK_myisam_mmap, "THR_LOCK_myisam_mmap", PSI_FLAG_SINGLETON, 0,
#define PSI_FLAG_SINGLETON
Singleton flag.
Definition: component_common.h:34
PSI_mutex_key key_IO_CACHE_SHARE_mutex
Definition: my_init.cc:459
PSI_mutex_key key_THR_LOCK_malloc
Definition: my_init.cc:461
PSI_mutex_key key_THR_LOCK_myisam_mmap
Definition: my_init.cc:463
PSI_mutex_key key_THR_LOCK_net
Definition: my_init.cc:462
PSI_mutex_key key_THR_LOCK_lock
Definition: my_init.cc:460
PSI_mutex_key key_THR_LOCK_threads
Definition: my_init.cc:462
PSI_mutex_key key_TMPDIR_mutex
Definition: my_init.cc:462
PSI_mutex_key key_THR_LOCK_mutex
Definition: my_init.cc:461
PSI_mutex_key key_IO_CACHE_append_buffer_lock
Definition: my_init.cc:459
PSI_mutex_key key_THR_LOCK_open
Definition: my_init.cc:462
PSI_mutex_key key_THR_LOCK_heap
Definition: my_init.cc:460
PSI_mutex_key key_THR_LOCK_myisam
Definition: my_init.cc:461
PSI_mutex_key key_KEY_CACHE_cache_lock
Definition: my_init.cc:460

◆ all_mysys_rwlocks

PSI_rwlock_info all_mysys_rwlocks[]
static
Initial value:
= {
{&key_SAFE_HASH_lock, "SAFE_HASH::lock", 0, 0, PSI_DOCUMENT_ME}}
PSI_rwlock_key key_SAFE_HASH_lock
Definition: my_init.cc:491

◆ all_mysys_stages

◆ all_mysys_thread

PSI_thread_info all_mysys_thread[]
static
Initial value:
= {
{&key_thread_timer_notifier, "thread_timer_notifier", "timer_notifier",
PSI_thread_key key_thread_timer_notifier
Definition: my_static.cc:71

◆ key_file_charset

PSI_file_key key_file_charset

◆ key_file_cnf

PSI_file_key key_file_cnf

◆ key_file_proc_meminfo

PSI_file_key key_file_proc_meminfo

◆ key_IO_CACHE_append_buffer_lock

PSI_mutex_key key_IO_CACHE_append_buffer_lock

◆ key_IO_CACHE_SHARE_cond

PSI_cond_key key_IO_CACHE_SHARE_cond

◆ key_IO_CACHE_SHARE_cond_writer

PSI_cond_key key_IO_CACHE_SHARE_cond_writer

◆ key_IO_CACHE_SHARE_mutex

PSI_mutex_key key_IO_CACHE_SHARE_mutex

◆ key_KEY_CACHE_cache_lock

PSI_mutex_key key_KEY_CACHE_cache_lock

◆ key_SAFE_HASH_lock

PSI_rwlock_key key_SAFE_HASH_lock

◆ key_THR_COND_threads

PSI_cond_key key_THR_COND_threads

◆ key_THR_LOCK_heap

PSI_mutex_key key_THR_LOCK_heap

◆ key_THR_LOCK_lock

PSI_mutex_key key_THR_LOCK_lock

◆ key_THR_LOCK_malloc

PSI_mutex_key key_THR_LOCK_malloc

◆ key_THR_LOCK_mutex

PSI_mutex_key key_THR_LOCK_mutex

◆ key_THR_LOCK_myisam

PSI_mutex_key key_THR_LOCK_myisam

◆ key_THR_LOCK_myisam_mmap

PSI_mutex_key key_THR_LOCK_myisam_mmap

◆ key_THR_LOCK_net

PSI_mutex_key key_THR_LOCK_net

◆ key_THR_LOCK_open

PSI_mutex_key key_THR_LOCK_open

◆ key_THR_LOCK_threads

PSI_mutex_key key_THR_LOCK_threads

◆ key_TMPDIR_mutex

PSI_mutex_key key_TMPDIR_mutex

◆ my_abort_func

void(* my_abort_func) () ( ) = abort
static

Pointer to function that handles abort.

It is the std's abort() by default.

◆ stage_waiting_for_disk_space

PSI_stage_info stage_waiting_for_disk_space
Initial value:
= {0, "Waiting for disk space", 0,

◆ stage_waiting_for_table_level_lock

PSI_stage_info stage_waiting_for_table_level_lock
Initial value:
= {
0, "Waiting for table level lock", 0, PSI_DOCUMENT_ME}