#include <errno.h>#include <pthread.h>Include dependency graph for my_pthread.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| struct | st_safe_mutex_t |
| struct | _my_rw_lock_t |
| struct | st_my_thread_var |
Defines | |
| #define | ETIME ETIMEDOUT |
| #define | EXTERNC |
| #define | pthread_key(T, V) pthread_key_t V |
| #define | my_pthread_getspecific_ptr(T, V) my_pthread_getspecific(T,(V)) |
| #define | my_pthread_setspecific_ptr(T, V) pthread_setspecific(T,(void*) (V)) |
| #define | pthread_detach_this_thread() |
| #define | pthread_handler_t EXTERNC void * |
| #define | my_sigwait(A, B) sigwait((A),(B)) |
| #define | my_sigset(A, B) signal((A),(B)) |
| #define | pthread_attr_setscope(A, B) |
| #define | my_pthread_getspecific(A, B) ((A) pthread_getspecific(B)) |
| #define | pthread_key_delete(A) pthread_dummy(0) |
| #define | HAVE_PTHREAD_KILL |
| #define | safe_mutex_assert_owner(mp) |
| #define | safe_mutex_assert_not_owner(mp) |
| #define | rw_lock_t my_rw_lock_t |
| #define | rw_rdlock(A) my_rw_rdlock((A)) |
| #define | rw_wrlock(A) my_rw_wrlock((A)) |
| #define | rw_tryrdlock(A) my_rw_tryrdlock((A)) |
| #define | rw_trywrlock(A) my_rw_trywrlock((A)) |
| #define | rw_unlock(A) my_rw_unlock((A)) |
| #define | rwlock_destroy(A) my_rwlock_destroy((A)) |
| #define | GETHOSTBYADDR_BUFF_SIZE 2048 |
| #define | thr_setconcurrency(A) pthread_dummy(0) |
| #define | pthread_attr_setstacksize(A, B) pthread_dummy(0) |
| #define | MY_MUTEX_INIT_SLOW NULL |
| #define | MY_MUTEX_INIT_FAST NULL |
| #define | MY_MUTEX_INIT_ERRCHK NULL |
| #define | THREAD_NAME_SIZE 10 |
| #define | DEFAULT_THREAD_STACK (192*1024) |
| #define | my_thread_var (_my_thread_var()) |
| #define | my_errno my_thread_var->thr_errno |
| #define | thread_safe_increment(V, L) (pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L))) |
| #define | thread_safe_decrement(V, L) (pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L))) |
| #define | thread_safe_add(V, C, L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L))) |
| #define | thread_safe_sub(V, C, L) (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L))) |
| #define | statistic_decrement(V, L) (V)-- |
| #define | statistic_increment(V, L) (V)++ |
| #define | statistic_add(V, C, L) (V)+=(C) |
Typedefs | |
| typedef void *(*) | pthread_handler (void *) |
| typedef st_safe_mutex_t | safe_mutex_t |
| typedef _my_rw_lock_t | my_rw_lock_t |
Functions | |
| int | my_pthread_getprio (pthread_t thread_id) |
| int | sigwait (sigset_t *setp, int *sigp) |
| void | my_pthread_setprio (pthread_t thread_id, int prior) |
| void | my_pthread_attr_setprio (pthread_attr_t *attr, int priority) |
| tm * | localtime_r (const time_t *clock, struct tm *res) |
| tm * | gmtime_r (const time_t *clock, struct tm *res) |
| int | safe_mutex_init (safe_mutex_t *mp, const pthread_mutexattr_t *attr, const char *file, uint line) |
| int | safe_mutex_lock (safe_mutex_t *mp, const char *file, uint line) |
| int | safe_mutex_unlock (safe_mutex_t *mp, const char *file, uint line) |
| int | safe_mutex_destroy (safe_mutex_t *mp, const char *file, uint line) |
| int | safe_cond_wait (pthread_cond_t *cond, safe_mutex_t *mp, const char *file, uint line) |
| int | safe_cond_timedwait (pthread_cond_t *cond, safe_mutex_t *mp, struct timespec *abstime, const char *file, uint line) |
| void | safe_mutex_global_init (void) |
| void | safe_mutex_end (FILE *file) |
| int | my_rwlock_init (my_rw_lock_t *, void *) |
| int | my_rwlock_destroy (my_rw_lock_t *) |
| int | my_rw_rdlock (my_rw_lock_t *) |
| int | my_rw_wrlock (my_rw_lock_t *) |
| int | my_rw_unlock (my_rw_lock_t *) |
| int | my_rw_tryrdlock (my_rw_lock_t *) |
| int | my_rw_trywrlock (my_rw_lock_t *) |
| my_bool | my_thread_global_init (void) |
| void | my_thread_global_end (void) |
| my_bool | my_thread_init (void) |
| void | my_thread_end (void) |
| const char * | my_thread_name (void) |
| long | my_thread_id (void) |
| int | pthread_no_free (void *) |
| int | pthread_dummy (int) |
| st_my_thread_var * | _my_thread_var (void) __attribute__((const )) |
Variables | |
| pthread_t | shutdown_th |
| pthread_t | main_th |
| pthread_t | signal_th |
| #define DEFAULT_THREAD_STACK (192*1024) |
Definition at line 577 of file my_pthread.h.
| #define ETIME ETIMEDOUT |
Definition at line 24 of file my_pthread.h.
Referenced by Thread_registry::cond_timedwait(), Thread_registry::deliver_shutdown(), handle_delayed_insert(), handle_manager(), Instance::stop(), Item_func_sleep::val_int(), and Item_func_get_lock::val_int().
| #define EXTERNC |
Definition at line 31 of file my_pthread.h.
| #define GETHOSTBYADDR_BUFF_SIZE 2048 |
| #define HAVE_PTHREAD_KILL |
Definition at line 344 of file my_pthread.h.
| #define my_errno my_thread_var->thr_errno |
Definition at line 603 of file my_pthread.h.
Referenced by _mi_check_index(), _mi_ck_real_delete(), _mi_cmp_dynamic_record(), _mi_cmp_static_record(), _mi_fetch_keypage(), _mi_find_last_pos(), _mi_find_writepos(), _mi_get_binary_pack_key(), _mi_get_block_info(), _mi_get_key(), _mi_get_last_key(), _mi_get_pack_key(), _mi_get_prev_key(), _mi_insert(), _mi_new(), _mi_pack_rec_unpack(), _mi_prefix_search(), _mi_read_cache(), _mi_read_dynamic_record(), _mi_read_key_record(), _mi_read_pack_info(), _mi_read_pack_record(), _mi_read_rnd_dynamic_record(), _mi_read_rnd_pack_record(), _mi_read_rnd_static_record(), _mi_read_static_record(), _mi_readinfo(), _mi_rec_unpack(), _mi_search(), _mi_search_first(), _mi_search_last(), _mi_search_pos(), _mi_seq_search(), _mi_update_blob_record(), _mi_write_blob_record(), _mi_write_keypage(), _mi_write_part_record(), _mi_write_static_record(), _mi_writeinfo(), _my_b_write(), _myisam_log(), _myisam_log_command(), _myisam_log_record(), _mymalloc(), _myrg_init_queue(), _myrg_mi_read_record(), ha_myisam::backup(), cache_remove_open_tmp(), check_binlog_magic(), copy_data_between_tables(), ha_heap::create(), create_frm(), create_temp_file(), d_search(), db_drop_events_from_table(), default_local_infile_init(), default_local_infile_read(), ha_tina::delete_all_rows(), handler::delete_all_rows(), delete_dynamic_record(), handler::delete_table(), do_test(), ha_myisam::enable_indexes(), examine_log(), execute_ddl_log_action(), filecopy(), find_all_keys(), find_files(), flush_blocks(), ft_boolean_read_next(), ft_nlq_read_next(), function(), handler::ha_open(), heap_delete(), heap_delete_table(), heap_open(), heap_rename(), heap_rfirst(), heap_rkey(), heap_rlast(), heap_rnext(), heap_rprev(), heap_rrnd(), heap_rsame(), heap_scan(), heap_update(), heap_write(), hp_close(), hp_delete_key(), hp_rb_write_key(), hp_rectest(), hp_search(), hp_search_next(), hp_write_key(), handler::index_read_last(), init_key_cache(), key_cache_read(), lock_file(), lock_memory(), main(), mi_assign_to_key_cache(), mi_check_unique(), mi_close(), mi_create(), mi_delete(), mi_delete_all_rows(), mi_delete_table(), mi_extra(), mi_lock_database(), mi_log(), mi_open(), mi_panic(), mi_preload(), mi_rename(), mi_repair(), mi_rkey(), mi_rnext(), mi_rnext_same(), mi_rprev(), mi_rrnd(), mi_rsame(), mi_rsame_with_pos(), mi_scan_init(), mi_update(), mi_write(), my_chsize(), my_close(), my_copy(), my_copystat(), my_create_with_symlink(), my_delete(), my_dir(), my_fclose(), my_fdopen(), my_fopen(), my_fread(), my_fwrite(), my_getwd(), my_lock(), my_lread(), my_lwrite(), my_malloc(), my_mkdir(), my_once_alloc(), my_pread(), my_pwrite(), my_quick_read(), my_quick_write(), my_read(), my_readlink(), my_realloc(), my_realpath(), my_register_filename(), my_rename(), my_rename_with_symlink(), my_seek(), my_setwd(), my_stat(), my_symlink(), my_sync(), my_tell(), my_write(), myisamchk(), myrg_close(), myrg_create(), myrg_delete(), myrg_open(), myrg_panic(), myrg_rfirst(), myrg_rkey(), myrg_rlast(), myrg_rrnd(), myrg_rsame(), myrg_update(), myrg_write(), mysql_create_db(), mysql_create_like_table(), mysql_insert(), mysql_load(), mysql_rename_table(), mysql_table_dump(), next_free_record_pos(), ha_archive::open(), ha_myisammrg::open(), ha_myisam::open(), ha_heap::open(), open_binlog(), open_isam_file(), open_table_def(), open_table_from_share(), open_unireg_entry(), ha_myisam::optimize(), plugin_load(), ha_myisam::preload_keys(), recreate_table(), handler::rename_table(), rename_tables(), ha_myisam::repair(), ha_myisam::restore(), rm_temporary_table(), run_test(), sort_one_index(), sort_record_index(), sort_write_record(), start_test(), test_read(), test_rrnd(), test_update(), test_write(), update_auto_increment_key(), update_backward_delete_link(), update_dynamic_record(), update_state_info(), w_search(), MYSQL_BIN_LOG::write(), write_data_suffix(), and write_record().
| #define MY_MUTEX_INIT_ERRCHK NULL |
Definition at line 554 of file my_pthread.h.
| #define MY_MUTEX_INIT_FAST NULL |
Definition at line 548 of file my_pthread.h.
Referenced by alloc_table_share(), archive_db_init(), bitmap_init(), hash_filo::clear(), delayed_insert::delayed_insert(), Event_timed::Event_timed(), example_init_func(), get_share(), ha_archive::get_share(), init_io_cache(), init_key_cache(), Event_scheduler::init_mutexes(), init_thread_environment(), init_tmpdir(), my_register_filename(), my_tz_init(), os_fast_mutex_init(), read_ddl_log_header(), sp_cache_init(), st_log_info::st_log_info(), table_def_init(), tina_init_func(), Worker_thread_param::Worker_thread_param(), and xid_cache_init().
| #define MY_MUTEX_INIT_SLOW NULL |
Definition at line 543 of file my_pthread.h.
Referenced by hostname_cache_init(), LOGGER::init_base(), MYSQL_BIN_LOG::init_pthread_objects(), MYSQL_LOG::init_pthread_objects(), init_thread_environment(), and item_user_lock_init().
Definition at line 275 of file my_pthread.h.
| #define my_pthread_getspecific_ptr | ( | T, | |||
| V | ) | my_pthread_getspecific(T,(V)) |
Definition at line 174 of file my_pthread.h.
Referenced by _current_thd(), grant_load(), open_table_def(), open_table_from_share(), and sql_alloc().
| #define my_pthread_setspecific_ptr | ( | T, | |||
| V | ) | pthread_setspecific(T,(void*) (V)) |
Definition at line 175 of file my_pthread.h.
Referenced by acl_init(), Log_to_csv_event_handler::close_log_table(), grant_init(), grant_load(), my_tz_init(), Log_to_csv_event_handler::open_log_table(), plugin_load(), and reload_acl_and_cache().
Definition at line 241 of file my_pthread.h.
| #define my_thread_var (_my_thread_var()) |
Definition at line 602 of file my_pthread.h.
Referenced by find_key_block(), get_hash_link(), my_fwrite(), my_pwrite(), my_write(), read_block(), resize_key_cache(), and wait_for_readers().
| #define pthread_attr_setscope | ( | A, | |||
| B | ) |
Definition at line 263 of file my_pthread.h.
Referenced by init_thread_environment(), and start_signal_handler().
| #define pthread_attr_setstacksize | ( | A, | |||
| B | ) | pthread_dummy(0) |
Definition at line 539 of file my_pthread.h.
Referenced by init_server_components(), main(), NdbThread_Create(), os_thread_create(), set_stacksize_n_create_thread(), and start_signal_handler().
| #define pthread_detach_this_thread | ( | ) |
Definition at line 176 of file my_pthread.h.
Referenced by event_scheduler_thread(), event_worker_thread(), handle_bootstrap(), handle_delayed_insert(), handle_manager(), and handle_one_connection().
| #define pthread_handler_t EXTERNC void * |
Definition at line 177 of file my_pthread.h.
| #define pthread_key | ( | T, | |||
| V | ) | pthread_key_t V |
Definition at line 173 of file my_pthread.h.
| #define pthread_key_delete | ( | A | ) | pthread_dummy(0) |
Definition at line 297 of file my_pthread.h.
| #define rw_lock_t my_rw_lock_t |
Definition at line 516 of file my_pthread.h.
Definition at line 517 of file my_pthread.h.
Definition at line 519 of file my_pthread.h.
Definition at line 520 of file my_pthread.h.
Definition at line 521 of file my_pthread.h.
Definition at line 518 of file my_pthread.h.
Definition at line 522 of file my_pthread.h.
| #define safe_mutex_assert_not_owner | ( | mp | ) |
| #define safe_mutex_assert_owner | ( | mp | ) |
Definition at line 439 of file my_pthread.h.
Referenced by acl_insert_db(), acl_insert_user(), acl_update_db(), acl_update_user(), MYSQL_BIN_LOG::appendv(), assign_new_table_id(), Table_triggers_list::change_table_name(), check_acl_user(), Table_triggers_list::drop_all_triggers(), find_acl_user(), MYSQL_BIN_LOG::find_log_pos(), MYSQL_BIN_LOG::find_next_log(), MYSQL_BIN_LOG::flush_and_sync(), get_cached_table_share(), get_key_cache(), handle_grant_struct(), lock_db_delete(), lock_db_insert(), mysql_ha_flush_table(), mysql_rm_table_part2(), MYSQL_BIN_LOG::new_file_impl(), open_unireg_entry(), release_table_share(), reopen_name_locked_table(), reopen_tables(), replace_user_table(), and wait_for_locked_table_names().
| #define statistic_add | ( | V, | |||
| C, | |||||
| L | ) | (V)+=(C) |
Definition at line 634 of file my_pthread.h.
| #define statistic_decrement | ( | V, | |||
| L | ) | (V)-- |
Definition at line 632 of file my_pthread.h.
| #define statistic_increment | ( | V, | |||
| L | ) | (V)++ |
Definition at line 633 of file my_pthread.h.
| #define thr_setconcurrency | ( | A | ) | pthread_dummy(0) |
| #define THREAD_NAME_SIZE 10 |
Definition at line 568 of file my_pthread.h.
| #define thread_safe_add | ( | V, | |||
| C, | |||||
| L | ) | (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L))) |
Definition at line 623 of file my_pthread.h.
| #define thread_safe_decrement | ( | V, | |||
| L | ) | (pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L))) |
Definition at line 621 of file my_pthread.h.
| #define thread_safe_increment | ( | V, | |||
| L | ) | (pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L))) |
Definition at line 619 of file my_pthread.h.
| #define thread_safe_sub | ( | V, | |||
| C, | |||||
| L | ) | (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L))) |
Definition at line 624 of file my_pthread.h.
| typedef struct _my_rw_lock_t my_rw_lock_t |
| typedef void*(* ) pthread_handler(void *) |
Definition at line 178 of file my_pthread.h.
| typedef struct st_safe_mutex_t safe_mutex_t |
| struct st_my_thread_var* _my_thread_var | ( | void | ) | const |
| struct tm* gmtime_r | ( | const time_t * | clock, | |
| struct tm * | res | |||
| ) |
Referenced by get_date(), and Time_zone_utc::gmt_sec_to_TIME().
Here is the caller graph for this function:

| struct tm* localtime_r | ( | const time_t * | clock, | |
| struct tm * | res | |||
| ) |
Referenced by get_date(), Time_zone_system::gmt_sec_to_TIME(), init_common_variables(), init_time(), log(), my_system_gmt_sec(), print_buffer_to_file(), ut_get_year_month_day(), ut_print_timestamp(), ut_sprintf_timestamp(), ut_sprintf_timestamp_without_extra_chars(), and MYSQL_QUERY_LOG::write().
Here is the caller graph for this function:

| void my_pthread_attr_setprio | ( | pthread_attr_t * | attr, | |
| int | priority | |||
| ) |
Referenced by init_thread_environment(), signal_hand(), and start_signal_handler().
Here is the caller graph for this function:

| int my_pthread_getprio | ( | pthread_t | thread_id | ) |
| void my_pthread_setprio | ( | pthread_t | thread_id, | |
| int | prior | |||
| ) |
Referenced by dispatch_command(), main(), mysql_stmt_execute(), mysql_stmt_fetch(), mysql_stmt_prepare(), and os_thread_create().
Here is the caller graph for this function:

| int my_rw_rdlock | ( | my_rw_lock_t * | ) |
| int my_rw_tryrdlock | ( | my_rw_lock_t * | ) |
| int my_rw_trywrlock | ( | my_rw_lock_t * | ) |
| int my_rw_unlock | ( | my_rw_lock_t * | ) |
| int my_rw_wrlock | ( | my_rw_lock_t * | ) |
| int my_rwlock_destroy | ( | my_rw_lock_t * | ) |
| int my_rwlock_init | ( | my_rw_lock_t * | , | |
| void * | ||||
| ) |
| void my_thread_end | ( | void | ) |
Referenced by end_thread(), event_scheduler_thread(), event_worker_thread(), handle_bootstrap(), handle_manager(), kill_server(), my_end(), mysql_thread_end(), NdbThread_Exit(), Mysql_connection_thread::run(), Listener_thread::run(), Guardian_thread::run(), run_task(), signal_hand(), and unireg_end().
Here is the caller graph for this function:

| void my_thread_global_end | ( | void | ) |
| my_bool my_thread_global_init | ( | void | ) |
| long my_thread_id | ( | void | ) |
Referenced by handler_error(), and print_signal_warning().
Here is the caller graph for this function:

| my_bool my_thread_init | ( | void | ) |
Referenced by event_scheduler_thread(), event_worker_thread(), handle_bootstrap(), handle_delayed_insert(), handle_manager(), handle_one_connection(), kill_server(), mysql_server_init(), mysql_thread_init(), ndb_thread_wrapper(), Mysql_connection_thread::run(), Listener_thread::run(), Guardian_thread::run(), and signal_hand().
Here is the caller graph for this function:

| const char* my_thread_name | ( | void | ) |
| int pthread_dummy | ( | int | ) |
| int pthread_no_free | ( | void * | ) |
| int safe_cond_timedwait | ( | pthread_cond_t * | cond, | |
| safe_mutex_t * | mp, | |||
| struct timespec * | abstime, | |||
| const char * | file, | |||
| uint | line | |||
| ) |
| int safe_cond_wait | ( | pthread_cond_t * | cond, | |
| safe_mutex_t * | mp, | |||
| const char * | file, | |||
| uint | line | |||
| ) |
| int safe_mutex_destroy | ( | safe_mutex_t * | mp, | |
| const char * | file, | |||
| uint | line | |||
| ) |
| void safe_mutex_end | ( | FILE * | file | ) |
| void safe_mutex_global_init | ( | void | ) |
| int safe_mutex_init | ( | safe_mutex_t * | mp, | |
| const pthread_mutexattr_t * | attr, | |||
| const char * | file, | |||
| uint | line | |||
| ) |
| int safe_mutex_lock | ( | safe_mutex_t * | mp, | |
| const char * | file, | |||
| uint | line | |||
| ) |
| int safe_mutex_unlock | ( | safe_mutex_t * | mp, | |
| const char * | file, | |||
| uint | line | |||
| ) |
| int sigwait | ( | sigset_t * | setp, | |
| int * | sigp | |||
| ) |
| pthread_t main_th |
| pthread_t shutdown_th |
| pthread_t signal_th |
1.4.7

