The world's most popular open source database
#include "univ.i"#include "sync0types.h"#include "ut0lst.h"#include "ut0mem.h"#include "os0thread.h"#include "os0sync.h"#include "sync0arr.h"Include dependency graph for sync0sync.h:

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

Go to the source code of this file.
| #define mutex_create | ( | M, | |||
| level | ) | mutex_create_func((M), (level), __FILE__, __LINE__, #M) |
Definition at line 42 of file sync0sync.h.
Referenced by buf_pool_init(), dict_init(), dict_mem_table_create(), fil_system_create(), hash_create_mutexes(), ib_wqueue_create(), ibuf_init_at_db_start(), innobase_start_or_create_for_mysql(), log_init(), mem_init(), mem_pool_create(), open_or_create_data_files(), recv_sys_create(), rw_lock_create_func(), srv_init(), sync_array_create(), sync_init(), thr_local_init(), trx_create(), trx_doublewrite_init(), trx_purge_sys_create(), and trx_rseg_mem_create().
| #define mutex_enter | ( | M | ) | mutex_enter_func((M), __FILE__, __LINE__) |
Definition at line 72 of file sync0sync.h.
Referenced by buf_all_freed(), buf_block_free(), buf_flush_batch(), buf_flush_buffered_writes(), buf_flush_LRU_recommendation(), buf_flush_post_to_doublewrite_buf(), buf_flush_try_neighbors(), buf_flush_try_page(), buf_flush_validate(), buf_get_free_list_len(), buf_get_latched_pages_number(), buf_get_modified_ratio_pct(), buf_LRU_buf_pool_running_out(), buf_LRU_get_free_block(), buf_LRU_get_recent_limit(), buf_LRU_invalidate_tablespace(), buf_LRU_search_and_free_block(), buf_LRU_try_free_flushed_blocks(), buf_page_create(), buf_page_get_gen(), buf_page_get_known_nowait(), buf_page_init_for_read(), buf_page_io_complete(), buf_page_make_young(), buf_page_optimistic_get_func(), buf_pool_check_no_pending_io(), buf_pool_init(), buf_pool_invalidate(), buf_print_io(), buf_read_ahead_linear(), buf_read_ahead_random(), dict_boot(), dict_check_tablespaces_and_store_max_id(), dict_create_foreign_constraints_low(), dict_create_or_check_foreign_constraint_tables(), dict_foreign_error_report(), dict_foreign_eval_sql(), dict_foreign_parse_drop_constraints(), dict_foreign_report_syntax_err(), dict_index_get_if_in_cache(), dict_mutex_enter_for_mysql(), dict_print(), dict_print_info_on_foreign_keys(), dict_table_autoinc_decrement(), dict_table_autoinc_get(), dict_table_autoinc_initialize(), dict_table_autoinc_read(), dict_table_autoinc_update(), dict_table_decrement_handle_count(), dict_table_get(), dict_table_get_and_increment_handle_count(), dict_table_get_on_id(), dict_table_print(), dict_table_print_by_name(), fil_aio_wait(), fil_assign_new_space_id(), fil_close_all_files(), fil_decr_pending_ibuf_merges(), fil_delete_tablespace(), fil_flush(), fil_flush_file_spaces(), fil_get_space_id_for_table(), fil_inc_pending_ibuf_merges(), fil_load_single_table_tablespace(), fil_mutex_enter_and_prepare_for_io(), fil_node_create(), fil_open_log_and_system_tablespace_files(), fil_print_orphaned_tablespaces(), fil_rename_tablespace(), fil_set_max_space_id_if_bigger(), fil_space_create(), fil_space_for_table_exists_in_mem(), fil_space_free(), fil_space_get_ibuf_data(), fil_space_get_latch(), fil_space_get_n_reserved_extents(), fil_space_get_type(), fil_space_get_version(), fil_space_release_free_extents(), fil_space_reserve_free_extents(), fil_space_truncate_start(), fil_tablespace_deleted_or_being_deleted_in_mem(), fil_tablespace_exists_in_mem(), fil_validate(), fil_write_flushed_lsn_to_data_files(), hash_mutex_enter(), hash_mutex_enter_all(), ib_wqueue_add(), ib_wqueue_wait(), ibuf_add_free_page(), ibuf_contract_after_insert(), ibuf_contract_ext(), ibuf_data_init_for_space(), ibuf_delete_for_discarded_space(), ibuf_delete_rec(), ibuf_free_excess_pages(), ibuf_insert_low(), ibuf_is_empty(), ibuf_merge_or_delete_for_page(), ibuf_print(), ibuf_remove_free_page(), ibuf_update_free_bits_for_two_pages_low(), innobase_start_or_create_for_mysql(), io_handler_thread(), lock_check_trx_id_sanity(), lock_rec_expl_exist_on_page(), lock_rec_reset_and_inherit_gap_locks(), lock_rec_unlock(), lock_reset_all_on_table(), lock_table_unlock(), lock_table_unlock_auto_inc(), log_buffer_flush_to_disk(), log_calc_max_ages(), log_check_margins(), log_checkpoint(), log_checkpoint_margin(), log_flush_margin(), log_fsp_current_free_limit_set_and_checkpoint(), log_init(), log_io_complete(), log_io_complete_checkpoint(), log_print(), log_reserve_and_open(), log_write_up_to(), logs_empty_and_mark_files_at_shutdown(), mem_area_alloc(), mem_area_free(), mem_field_erase(), mem_field_init(), mem_pool_get_reserved(), mem_pool_mutex_enter(), mem_pool_print_info(), mem_pool_validate(), mem_print_info_low(), mutex_create_func(), mutex_enter_noninline(), mutex_free(), que_eval_sql(), que_run_threads(), que_thr_dec_refer_count(), que_thr_node_step(), que_thr_stop_for_mysql(), read_cursor_set_for_mysql(), read_cursor_view_close_for_mysql(), read_cursor_view_create_for_mysql(), read_view_close_for_mysql(), recv_apply_hashed_log_recs(), recv_read_in_area(), recv_recover_page(), recv_recovery_from_checkpoint_start(), recv_reset_logs(), recv_synchronize_groups(), recv_sys_free(), recv_sys_init(), row_add_table_to_background_drop_list(), row_check_table_for_mysql(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_drop_tables_for_mysql_in_background(), row_ins_check_foreign_constraints(), row_ins_foreign_report_add_err(), row_ins_foreign_report_err(), row_ins_set_detailed(), row_mysql_lock_data_dictionary(), row_purge_parse_undo_rec(), row_search_check_if_query_cache_permitted(), row_search_for_mysql(), row_truncate_table_for_mysql(), row_upd_check_references_constraints(), row_vers_build_for_semi_consistent_read(), row_vers_impl_x_locked_off_kernel(), rw_lock_create_func(), rw_lock_free(), rw_lock_is_locked(), rw_lock_s_lock_spin(), rw_lock_validate(), rw_lock_x_lock_func(), rw_lock_x_lock_move_ownership(), srv_active_wake_master_thread(), srv_export_innodb_status(), srv_get_n_threads(), srv_get_thread_type(), srv_lock_timeout_and_monitor_thread(), srv_master_thread(), srv_printf_innodb_monitor(), srv_que_round_robin(), srv_que_task_enqueue(), srv_que_task_queue_check(), srv_refresh_innodb_monitor_stats(), srv_suspend_mysql_thread(), srv_wake_master_thread(), sync_array_enter(), sync_thread_add_level(), sync_thread_levels_empty_gen(), sync_thread_reset_level(), thr_local_create(), thr_local_free(), thr_local_get(), thr_local_get_in_ibuf_field(), thr_local_get_slot_no(), thr_local_set_slot_no(), trx_allocate_for_background(), trx_allocate_for_mysql(), trx_assign_read_view(), trx_commit_for_mysql(), trx_commit_off_kernel(), trx_commit_step(), trx_free_for_background(), trx_free_for_mysql(), trx_general_rollback_for_mysql(), trx_get_trx_by_xid(), trx_prepare_for_mysql(), trx_prepare_off_kernel(), trx_purge(), trx_purge_add_update_undo_to_history(), trx_purge_choose_next_log(), trx_purge_fetch_next_rec(), trx_purge_free_segment(), trx_purge_rec_release(), trx_purge_rseg_get_next_history_log(), trx_purge_truncate_rseg_history(), trx_recover_for_mysql(), trx_roll_pop_top_rec_of_trx(), trx_rollback_or_clean_all_without_sess(), trx_rollback_step(), trx_rseg_create(), trx_start(), trx_sys_init_at_db_start(), trx_sysf_create(), trx_undo_assign_undo(), trx_undo_insert_cleanup(), trx_undo_mem_create_at_db_start(), trx_undo_rec_release(), trx_undo_rec_reserve(), trx_undo_report_row_operation(), and trx_undo_seg_free().
| #define mutex_enter_fast | ( | M | ) | mutex_enter_func((M), __FILE__, __LINE__) |
Definition at line 88 of file sync0sync.h.
Referenced by buf_page_get_gen(), buf_page_peek_block(), buf_page_peek_if_search_hashed(), buf_page_reset_file_page_was_freed(), buf_page_set_file_page_was_freed(), buf_reset_check_index_page_at_flush(), and rw_lock_x_lock_func().
| #define mutex_enter_fast_func mutex_enter_func; |
Definition at line 89 of file sync0sync.h.
| #define MUTEX_MAGIC_N (ulint)979585 |
Definition at line 491 of file sync0sync.h.
Referenced by mutex_create_func(), mutex_free(), mutex_validate(), and sync_thread_levels_g().
| #define RW_LOCK_EX 351 |
Definition at line 444 of file sync0sync.h.
Referenced by btr_page_split_and_insert(), btr_search_build_page_hash_index(), btr_search_check_free_space_in_heap(), btr_search_drop_page_hash_index(), btr_search_guess_on_hash(), btr_search_info_update_hash(), btr_search_info_update_slow(), btr_search_move_or_delete_hash_entries(), btr_search_update_block_hash_info(), btr_search_update_hash_node_on_insert(), btr_search_update_hash_on_delete(), btr_search_update_hash_on_insert(), btr_search_update_hash_ref(), ibuf_free_excess_pages(), row_create_index_for_mysql(), row_create_table_for_mysql(), row_drop_table_for_mysql(), row_table_add_foreign_constraints(), row_truncate_table_for_mysql(), rw_lock_is_locked(), rw_lock_validate(), rw_lock_x_lock_func(), rw_lock_x_lock_low(), rw_lock_x_lock_move_ownership(), sync_arr_cell_can_wake_up(), and sync_array_cell_print().
| #define RW_LOCK_EXCLUSIVE 351 |
Definition at line 445 of file sync0sync.h.
| #define RW_LOCK_NOT_LOCKED 350 |
Definition at line 443 of file sync0sync.h.
Referenced by btr_cur_search_to_nth_level(), row_search_for_mysql(), rw_lock_create_func(), rw_lock_free(), rw_lock_s_lock_spin(), rw_lock_validate(), rw_lock_x_lock_func(), rw_lock_x_lock_low(), sync_arr_cell_can_wake_up(), and sync_array_cell_print().
| #define RW_LOCK_SHARED 352 |
Definition at line 446 of file sync0sync.h.
Referenced by btr_search_build_page_hash_index(), btr_search_check_free_space_in_heap(), btr_search_drop_page_hash_index(), btr_search_info_update_hash(), btr_search_info_update_slow(), btr_search_update_block_hash_info(), btr_search_update_hash_ref(), row_ins_check_foreign_constraint(), row_sel_try_search_shortcut(), row_vers_build_for_consistent_read(), row_vers_build_for_semi_consistent_read(), row_vers_impl_x_locked_off_kernel(), row_vers_must_preserve_del_marked(), row_vers_old_has_index_entry(), rw_lock_is_locked(), rw_lock_s_lock_spin(), sync_arr_cell_can_wake_up(), sync_array_cell_print(), trx_purge_update_undo_must_exist(), trx_undo_get_undo_rec(), and trx_undo_prev_version_build().
| #define RW_LOCK_WAIT_EX 353 |
Definition at line 447 of file sync0sync.h.
Referenced by rw_lock_validate(), rw_lock_x_lock_func(), rw_lock_x_lock_low(), and sync_arr_cell_can_wake_up().
| #define SYNC_ANY_LATCH 135 |
Definition at line 437 of file sync0sync.h.
Referenced by dict_init(), fil_system_create(), innobase_start_or_create_for_mysql(), and sync_thread_add_level().
| #define SYNC_BUF_BLOCK 149 |
| #define SYNC_BUF_POOL 150 |
Definition at line 434 of file sync0sync.h.
Referenced by buf_pool_init(), and sync_thread_add_level().
| #define SYNC_DICT 1000 |
Definition at line 389 of file sync0sync.h.
Referenced by dict_init(), sync_thread_add_level(), and sync_thread_levels_empty_gen().
| #define SYNC_DICT_AUTOINC_MUTEX 999 |
Definition at line 390 of file sync0sync.h.
Referenced by dict_mem_table_create(), and sync_thread_add_level().
| #define SYNC_DICT_HEADER 995 |
Definition at line 391 of file sync0sync.h.
Referenced by dict_hdr_get(), and sync_thread_add_level().
| #define SYNC_DICT_OPERATION 1001 |
Definition at line 385 of file sync0sync.h.
Referenced by dict_init(), innobase_start_or_create_for_mysql(), sync_thread_add_level(), and sync_thread_levels_empty_gen().
| #define SYNC_DOUBLEWRITE 140 |
Definition at line 436 of file sync0sync.h.
Referenced by sync_thread_add_level(), and trx_doublewrite_init().
| #define SYNC_EXTERN_STORAGE 500 |
Definition at line 410 of file sync0sync.h.
Referenced by btr_copy_externally_stored_field(), btr_free_externally_stored_field(), btr_store_big_rec_extern_fields(), and sync_thread_add_level().
| #define SYNC_FSP 400 |
Definition at line 411 of file sync0sync.h.
Referenced by fil_space_create(), and sync_thread_add_level().
| #define SYNC_FSP_PAGE 395 |
Definition at line 412 of file sync0sync.h.
Referenced by fseg_alloc_free_page_low(), fsp_alloc_free_page(), fsp_alloc_seg_inode(), fsp_alloc_seg_inode_page(), fsp_fill_free_list(), fsp_get_space_header(), fsp_header_init(), sync_thread_add_level(), xdes_get_descriptor(), and xdes_get_descriptor_with_space_hdr().
| #define SYNC_IBUF_BITMAP 350 |
Definition at line 417 of file sync0sync.h.
Referenced by ibuf_bitmap_get_map_page(), and sync_thread_add_level().
| #define SYNC_IBUF_BITMAP_MUTEX 351 |
Definition at line 416 of file sync0sync.h.
Referenced by ibuf_init_at_db_start(), and sync_thread_add_level().
| #define SYNC_IBUF_HEADER 914 |
Definition at line 392 of file sync0sync.h.
Referenced by ibuf_header_page_get(), and sync_thread_add_level().
| #define SYNC_IBUF_MUTEX 910 |
Definition at line 394 of file sync0sync.h.
Referenced by ibuf_init_at_db_start(), and sync_thread_add_level().
| #define SYNC_IBUF_PESS_INSERT_MUTEX 912 |
Definition at line 393 of file sync0sync.h.
Referenced by ibuf_init_at_db_start(), and sync_thread_add_level().
| #define SYNC_INDEX_TREE 900 |
Definition at line 399 of file sync0sync.h.
Referenced by dict_tree_create(), and sync_thread_add_level().
| #define SYNC_INFINITE_TIME ((ulint)(-1)) |
Definition at line 504 of file sync0sync.h.
| #define SYNC_KERNEL 300 |
| #define SYNC_LEVEL_VARYING 2000 |
Definition at line 379 of file sync0sync.h.
Referenced by buf_block_init(), and sync_thread_add_level().
| #define SYNC_LOG 170 |
| #define SYNC_MEM_HASH 131 |
| #define SYNC_MEM_POOL 130 |
Definition at line 440 of file sync0sync.h.
Referenced by mem_pool_create(), and sync_thread_add_level().
| #define SYNC_MUTEX 354 |
Definition at line 448 of file sync0sync.h.
Referenced by mutex_spin_wait(), sync_arr_cell_can_wake_up(), sync_array_cell_print(), and sync_array_reserve_cell().
| #define SYNC_NO_ORDER_CHECK 3000 |
Definition at line 377 of file sync0sync.h.
Referenced by btr_free_externally_stored_field(), btr_store_big_rec_extern_fields(), buf_block_init(), buf_page_optimistic_get_func(), innobase_start_or_create_for_mysql(), lock_rec_print(), lock_rec_validate_page(), log_init(), open_or_create_data_files(), recv_apply_hashed_log_recs(), recv_recover_page(), rw_lock_create_func(), srv_init(), sync_array_create(), sync_init(), sync_thread_add_level(), trx_sys_create_doublewrite_buf(), and trx_sys_mark_upgraded_to_multiple_tablespaces().
| #define SYNC_PURGE_LATCH 800 |
Definition at line 404 of file sync0sync.h.
Referenced by sync_thread_add_level(), and trx_purge_sys_create().
| #define SYNC_PURGE_SYS 810 |
Definition at line 403 of file sync0sync.h.
Referenced by sync_thread_add_level(), and trx_purge_sys_create().
| #define SYNC_REC_LOCK 299 |
| #define SYNC_RECV 168 |
Definition at line 426 of file sync0sync.h.
Referenced by recv_sys_create(), and sync_thread_add_level().
| #define SYNC_RSEG 600 |
Definition at line 406 of file sync0sync.h.
Referenced by sync_thread_add_level(), and trx_rseg_mem_create().
| #define SYNC_RSEG_HEADER 590 |
| #define SYNC_RSEG_HEADER_NEW 591 |
Definition at line 407 of file sync0sync.h.
Referenced by sync_thread_add_level(), and trx_rseg_header_create().
| #define SYNC_SEARCH_SYS 160 |
Definition at line 428 of file sync0sync.h.
Referenced by btr_search_sys_create(), and sync_thread_add_level().
| #define SYNC_SPIN_ROUNDS srv_n_spin_wait_rounds |
Definition at line 502 of file sync0sync.h.
Referenced by mutex_spin_wait(), rw_lock_s_lock_spin(), and rw_lock_x_lock_func().
| #define SYNC_THR_LOCAL 133 |
Definition at line 438 of file sync0sync.h.
Referenced by sync_thread_add_level(), and thr_local_init().
| #define SYNC_TIME_EXCEEDED (ulint)1 |
Definition at line 508 of file sync0sync.h.
| #define SYNC_TREE_NODE 890 |
Definition at line 402 of file sync0sync.h.
Referenced by btr_cur_search_to_nth_level(), btr_pcur_restore_position(), ibuf_data_init_for_space(), ibuf_get_volume_buffered(), ibuf_merge_or_delete_for_page(), ibuf_remove_free_page(), ibuf_tree_root_get(), and sync_thread_add_level().
| #define SYNC_TREE_NODE_FROM_HASH 891 |
Definition at line 401 of file sync0sync.h.
Referenced by btr_search_drop_page_hash_when_freed(), btr_search_guess_on_hash(), and sync_thread_add_level().
| #define SYNC_TREE_NODE_NEW 892 |
Definition at line 400 of file sync0sync.h.
Referenced by btr_create(), btr_page_alloc(), btr_page_alloc_for_ibuf(), ibuf_add_free_page(), and sync_thread_add_level().
| #define SYNC_TRX_LOCK_HEAP 298 |
| #define SYNC_TRX_SYS_HEADER 290 |
Definition at line 424 of file sync0sync.h.
Referenced by sync_thread_add_level(), and trx_sysf_create().
| #define SYNC_TRX_UNDO 700 |
Definition at line 405 of file sync0sync.h.
Referenced by sync_thread_add_level(), and trx_create().
| #define SYNC_TRX_UNDO_PAGE 570 |
Definition at line 409 of file sync0sync.h.
Referenced by row_purge_upd_exist_or_extern(), sync_thread_add_level(), trx_undo_report_row_operation(), and trx_undo_seg_create().
| #define SYNC_USER_TRX_LOCK 9999 |
Definition at line 376 of file sync0sync.h.
| #define SYNC_WORK_QUEUE 161 |
Definition at line 427 of file sync0sync.h.
Referenced by ib_wqueue_create(), and sync_thread_add_level().
| void mutex_create_func | ( | mutex_t * | mutex, | |
| ulint | level, | |||
| const char * | cfile_name, | |||
| ulint | cline, | |||
| const char * | cmutex_name | |||
| ) |
Definition at line 202 of file sync0sync.c.
References list(), mutex, mutex_enter, mutex_exit(), mutex_list, mutex_list_mutex, MUTEX_MAGIC_N, mutex_set_waiters(), os_fast_mutex_init(), sync_thread_mutex, ut_a, ut_ad, UT_LIST_ADD_FIRST, UT_LIST_GET_FIRST, and UT_LIST_GET_LEN.
00204 : pointer to memory */ 00205 ulint level, /* in: level */ 00206 const char* cfile_name, /* in: file name where created */ 00207 ulint cline, /* in: file line where created */ 00208 const char* cmutex_name) /* in: mutex name */ 00209 { 00210 #if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER) 00211 mutex_reset_lock_word(mutex); 00212 #else 00213 os_fast_mutex_init(&(mutex->os_fast_mutex)); 00214 mutex->lock_word = 0; 00215 #endif 00216 mutex_set_waiters(mutex, 0); 00217 mutex->magic_n = MUTEX_MAGIC_N; 00218 #ifdef UNIV_SYNC_DEBUG 00219 mutex->line = 0; 00220 mutex->file_name = "not yet reserved"; 00221 #endif /* UNIV_SYNC_DEBUG */ 00222 mutex->level = level; 00223 mutex->cfile_name = cfile_name; 00224 mutex->cline = cline; 00225 #ifndef UNIV_HOTBACKUP 00226 mutex->cmutex_name= cmutex_name; 00227 mutex->count_using= 0; 00228 mutex->mutex_type= 0; 00229 mutex->lspent_time= 0; 00230 mutex->lmax_spent_time= 0; 00231 mutex->count_spin_loop= 0; 00232 mutex->count_spin_rounds= 0; 00233 mutex->count_os_wait= 0; 00234 mutex->count_os_yield= 0; 00235 #endif /* !UNIV_HOTBACKUP */ 00236 00237 /* Check that lock_word is aligned; this is important on Intel */ 00238 ut_ad(((ulint)(&(mutex->lock_word))) % 4 == 0); 00239 00240 /* NOTE! The very first mutexes are not put to the mutex list */ 00241 00242 if ((mutex == &mutex_list_mutex) || (mutex == &sync_thread_mutex)) { 00243 00244 return; 00245 } 00246 00247 mutex_enter(&mutex_list_mutex); 00248 00249 if (UT_LIST_GET_LEN(mutex_list) > 0) { 00250 ut_a(UT_LIST_GET_FIRST(mutex_list)->magic_n == MUTEX_MAGIC_N); 00251 } 00252 00253 UT_LIST_ADD_FIRST(list, mutex_list, mutex); 00254 00255 mutex_exit(&mutex_list_mutex); 00256 }
Here is the call graph for this function:

| void mutex_enter_noninline | ( | mutex_t * | mutex | ) |
Definition at line 177 of file sync0sync.c.
References mutex, and mutex_enter.
00179 : mutex */ 00180 { 00181 mutex_enter(mutex); 00182 }
| UNIV_INLINE void mutex_exit | ( | mutex_t * | mutex | ) |
Referenced by buf_block_free(), buf_flush_batch(), buf_flush_buffered_writes(), buf_flush_LRU_recommendation(), buf_flush_post_to_doublewrite_buf(), buf_flush_try_neighbors(), buf_flush_try_page(), buf_flush_validate(), buf_get_free_list_len(), buf_get_latched_pages_number(), buf_get_modified_ratio_pct(), buf_LRU_buf_pool_running_out(), buf_LRU_get_free_block(), buf_LRU_get_recent_limit(), buf_LRU_invalidate_tablespace(), buf_LRU_search_and_free_block(), buf_LRU_try_free_flushed_blocks(), buf_page_create(), buf_page_get_gen(), buf_page_get_known_nowait(), buf_page_init_for_read(), buf_page_io_complete(), buf_page_make_young(), buf_page_optimistic_get_func(), buf_page_peek_block(), buf_page_peek_if_search_hashed(), buf_page_reset_file_page_was_freed(), buf_page_set_file_page_was_freed(), buf_pool_check_no_pending_io(), buf_pool_invalidate(), buf_print_io(), buf_read_ahead_linear(), buf_read_ahead_random(), buf_reset_check_index_page_at_flush(), dict_boot(), dict_check_tablespaces_and_store_max_id(), dict_create_foreign_constraints_low(), dict_create_or_check_foreign_constraint_tables(), dict_foreign_error_report(), dict_foreign_eval_sql(), dict_foreign_parse_drop_constraints(), dict_foreign_report_syntax_err(), dict_index_get_if_in_cache(), dict_mutex_exit_for_mysql(), dict_print(), dict_print_info_on_foreign_keys(), dict_table_autoinc_decrement(), dict_table_autoinc_get(), dict_table_autoinc_initialize(), dict_table_autoinc_read(), dict_table_autoinc_update(), dict_table_decrement_handle_count(), dict_table_get(), dict_table_get_and_increment_handle_count(), dict_table_get_on_id(), dict_table_print(), dict_table_print_by_name(), fil_aio_wait(), fil_assign_new_space_id(), fil_close_all_files(), fil_decr_pending_ibuf_merges(), fil_delete_tablespace(), fil_extend_space_to_desired_size(), fil_flush(), fil_flush_file_spaces(), fil_get_space_id_for_table(), fil_inc_pending_ibuf_merges(), fil_io(), fil_load_single_table_tablespace(), fil_mutex_enter_and_prepare_for_io(), fil_node_create(), fil_open_log_and_system_tablespace_files(), fil_print_orphaned_tablespaces(), fil_rename_tablespace(), fil_set_max_space_id_if_bigger(), fil_space_create(), fil_space_for_table_exists_in_mem(), fil_space_free(), fil_space_get_ibuf_data(), fil_space_get_latch(), fil_space_get_n_reserved_extents(), fil_space_get_size(), fil_space_get_type(), fil_space_get_version(), fil_space_release_free_extents(), fil_space_reserve_free_extents(), fil_space_truncate_start(), fil_tablespace_deleted_or_being_deleted_in_mem(), fil_tablespace_exists_in_mem(), fil_validate(), fil_write_flushed_lsn_to_data_files(), hash_mutex_exit(), hash_mutex_exit_all(), ib_wqueue_add(), ib_wqueue_wait(), ibuf_add_free_page(), ibuf_contract_after_insert(), ibuf_contract_ext(), ibuf_data_init_for_space(), ibuf_delete_for_discarded_space(), ibuf_delete_rec(), ibuf_free_excess_pages(), ibuf_insert_low(), ibuf_is_empty(), ibuf_merge_or_delete_for_page(), ibuf_remove_free_page(), ibuf_update_free_bits_for_two_pages_low(), innobase_start_or_create_for_mysql(), io_handler_thread(), lock_check_trx_id_sanity(), lock_rec_expl_exist_on_page(), lock_rec_reset_and_inherit_gap_locks(), lock_rec_unlock(), lock_reset_all_on_table(), lock_table_unlock(), lock_table_unlock_auto_inc(), log_buffer_flush_to_disk(), log_calc_max_ages(), log_check_margins(), log_checkpoint(), log_checkpoint_margin(), log_flush_margin(), log_fsp_current_free_limit_set_and_checkpoint(), log_init(), log_io_complete(), log_io_complete_checkpoint(), log_peek_lsn(), log_print(), log_reserve_and_open(), log_write_up_to(), logs_empty_and_mark_files_at_shutdown(), mem_area_alloc(), mem_area_free(), mem_field_erase(), mem_field_init(), mem_pool_get_reserved(), mem_pool_mutex_exit(), mem_pool_validate(), mem_print_info_low(), mutex_create_func(), mutex_exit_noninline(), mutex_free(), que_eval_sql(), que_run_threads(), que_thr_dec_refer_count(), que_thr_node_step(), que_thr_stop_for_mysql(), read_cursor_set_for_mysql(), read_cursor_view_close_for_mysql(), read_cursor_view_create_for_mysql(), read_view_close_for_mysql(), recv_apply_hashed_log_recs(), recv_read_in_area(), recv_recover_page(), recv_recovery_from_checkpoint_start(), recv_reset_logs(), recv_synchronize_groups(), recv_sys_free(), recv_sys_init(), row_add_table_to_background_drop_list(), row_check_table_for_mysql(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_drop_tables_for_mysql_in_background(), row_ins_check_foreign_constraints(), row_ins_foreign_report_add_err(), row_ins_foreign_report_err(), row_ins_set_detailed(), row_mysql_unlock_data_dictionary(), row_purge_parse_undo_rec(), row_search_check_if_query_cache_permitted(), row_search_for_mysql(), row_truncate_table_for_mysql(), row_upd_check_references_constraints(), row_vers_build_for_semi_consistent_read(), row_vers_impl_x_locked_off_kernel(), rw_lock_create_func(), rw_lock_free(), rw_lock_is_locked(), rw_lock_s_lock_spin(), rw_lock_validate(), rw_lock_x_lock_func(), rw_lock_x_lock_move_ownership(), srv_active_wake_master_thread(), srv_export_innodb_status(), srv_get_n_threads(), srv_get_thread_type(), srv_lock_timeout_and_monitor_thread(), srv_master_thread(), srv_printf_innodb_monitor(), srv_que_round_robin(), srv_que_task_enqueue(), srv_que_task_queue_check(), srv_refresh_innodb_monitor_stats(), srv_suspend_mysql_thread(), srv_wake_master_thread(), sync_array_exit(), sync_thread_levels_empty_gen(), sync_thread_reset_level(), thr_local_create(), thr_local_free(), thr_local_get(), thr_local_get_in_ibuf_field(), thr_local_get_slot_no(), thr_local_set_slot_no(), trx_allocate_for_background(), trx_allocate_for_mysql(), trx_assign_read_view(), trx_commit_for_mysql(), trx_commit_off_kernel(), trx_commit_step(), trx_free_for_background(), trx_free_for_mysql(), trx_general_rollback_for_mysql(), trx_get_trx_by_xid(), trx_prepare_for_mysql(), trx_prepare_off_kernel(), trx_purge(), trx_purge_add_update_undo_to_history(), trx_purge_choose_next_log(), trx_purge_fetch_next_rec(), trx_purge_free_segment(), trx_purge_rec_release(), trx_purge_rseg_get_next_history_log(), trx_purge_truncate_rseg_history(), trx_recover_for_mysql(), trx_roll_pop_top_rec_of_trx(), trx_rollback_or_clean_all_without_sess(), trx_rollback_step(), trx_rseg_create(), trx_start(), trx_sysf_create(), trx_undo_assign_undo(), trx_undo_insert_cleanup(), trx_undo_mem_create_at_db_start(), trx_undo_rec_release(), trx_undo_rec_reserve(), trx_undo_report_row_operation(), and trx_undo_seg_free().
Here is the caller graph for this function:

| void mutex_exit_noninline | ( | mutex_t * | mutex | ) |
Definition at line 188 of file sync0sync.c.
References mutex, and mutex_exit().
00190 : mutex */ 00191 { 00192 mutex_exit(mutex); 00193 }
Here is the call graph for this function:

| void mutex_free | ( | mutex_t * | mutex | ) |
Definition at line 264 of file sync0sync.c.
References list(), mutex, mutex_enter, mutex_exit(), mutex_get_lock_word(), mutex_list, mutex_list_mutex, MUTEX_MAGIC_N, mutex_validate(), os_fast_mutex_free(), sync_thread_mutex, ut_a, UT_LIST_GET_NEXT, UT_LIST_GET_PREV, and UT_LIST_REMOVE.
Referenced by dict_mem_table_free(), ib_wqueue_free(), innobase_shutdown_for_mysql(), rw_lock_free(), sync_array_free(), sync_close(), and trx_free().
00266 : mutex */ 00267 { 00268 #ifdef UNIV_DEBUG 00269 ut_a(mutex_validate(mutex)); 00270 #endif /* UNIV_DEBUG */ 00271 ut_a(mutex_get_lock_word(mutex) == 0); 00272 ut_a(mutex_get_waiters(mutex) == 0); 00273 00274 if (mutex != &mutex_list_mutex && mutex != &sync_thread_mutex) { 00275 00276 mutex_enter(&mutex_list_mutex); 00277 00278 if (UT_LIST_GET_PREV(list, mutex)) { 00279 ut_a(UT_LIST_GET_PREV(list, mutex)->magic_n 00280 == MUTEX_MAGIC_N); 00281 } 00282 if (UT_LIST_GET_NEXT(list, mutex)) { 00283 ut_a(UT_LIST_GET_NEXT(list, mutex)->magic_n 00284 == MUTEX_MAGIC_N); 00285 } 00286 00287 UT_LIST_REMOVE(list, mutex_list, mutex); 00288 00289 mutex_exit(&mutex_list_mutex); 00290 } 00291 00292 #if !defined(_WIN32) || !defined(UNIV_CAN_USE_X86_ASSEMBLER) 00293 os_fast_mutex_free(&(mutex->os_fast_mutex)); 00294 #endif 00295 /* If we free the mutex protecting the mutex list (freeing is 00296 not necessary), we have to reset the magic number AFTER removing 00297 it from the list. */ 00298 00299 mutex->magic_n = 0; 00300 }
Here is the call graph for this function:

Here is the caller graph for this function:

Referenced by mutex_free(), mutex_spin_wait(), sync_arr_cell_can_wake_up(), and sync_thread_levels_g().
Here is the caller graph for this function:

| ibool mutex_validate | ( | mutex_t * | mutex | ) |
Definition at line 335 of file sync0sync.c.
References mutex, MUTEX_MAGIC_N, TRUE, and ut_a.
Referenced by mutex_enter_nowait(), and mutex_free().
00338 { 00339 ut_a(mutex); 00340 ut_a(mutex->magic_n == MUTEX_MAGIC_N); 00341 00342 return(TRUE); 00343 }
Here is the caller graph for this function:

| ibool sync_all_freed | ( | void | ) |
| void sync_close | ( | void | ) |
Definition at line 1306 of file sync0sync.c.
References mutex, mutex_free(), mutex_list, mutex_list_mutex, sync_array_free(), sync_primary_wait_array, sync_thread_mutex, and UT_LIST_GET_FIRST.
Referenced by innobase_shutdown_for_mysql().
01308 { 01309 mutex_t* mutex; 01310 01311 sync_array_free(sync_primary_wait_array); 01312 01313 mutex = UT_LIST_GET_FIRST(mutex_list); 01314 01315 while (mutex) { 01316 mutex_free(mutex); 01317 mutex = UT_LIST_GET_FIRST(mutex_list); 01318 } 01319 01320 mutex_free(&mutex_list_mutex); 01321 mutex_free(&sync_thread_mutex); 01322 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void sync_init | ( | void | ) |
Definition at line 1254 of file sync0sync.c.
References FALSE, sync_thread_struct::levels, mutex_create, mutex_list, mutex_list_mutex, NULL, os_event_create(), OS_THREAD_MAX_N, rw_lock_list, rw_lock_list_mutex, sync_array_create(), SYNC_ARRAY_OS_MUTEX, sync_initialized, SYNC_NO_ORDER_CHECK, sync_primary_wait_array, sync_thread_level_arrays, sync_thread_level_arrays_get_nth(), sync_thread_mutex, TRUE, ut_a, UT_LIST_INIT, and ut_malloc().
Referenced by srv_general_init().
01256 { 01257 sync_thread_t* thread_slot; 01258 ulint i; 01259 01260 ut_a(sync_initialized == FALSE); 01261 01262 sync_initialized = TRUE; 01263 01264 /* Create the primary system wait array which is protected by an OS 01265 mutex */ 01266 01267 sync_primary_wait_array = sync_array_create(OS_THREAD_MAX_N, 01268 SYNC_ARRAY_OS_MUTEX); 01269 01270 /* Create the thread latch level array where the latch levels 01271 are stored for each OS thread */ 01272 01273 sync_thread_level_arrays = ut_malloc(OS_THREAD_MAX_N 01274 * sizeof(sync_thread_t)); 01275 for (i = 0; i < OS_THREAD_MAX_N; i++) { 01276 01277 thread_slot = sync_thread_level_arrays_get_nth(i); 01278 thread_slot->levels = NULL; 01279 } 01280 01281 /* Init the mutex list and create the mutex to protect it. */ 01282 01283 UT_LIST_INIT(mutex_list); 01284 mutex_create(&mutex_list_mutex, SYNC_NO_ORDER_CHECK); 01285 01286 mutex_create(&sync_thread_mutex, SYNC_NO_ORDER_CHECK); 01287 01288 /* Init the rw-lock list and create the mutex to protect it. */ 01289 01290 UT_LIST_INIT(rw_lock_list); 01291 mutex_create(&rw_lock_list_mutex, SYNC_NO_ORDER_CHECK); 01292 01293 #ifdef UNIV_SYNC_DEBUG 01294 mutex_create(&rw_lock_debug_mutex, SYNC_NO_ORDER_CHECK); 01295 01296 rw_lock_debug_event = os_event_create(NULL); 01297 rw_lock_debug_waiters = FALSE; 01298 #endif /* UNIV_SYNC_DEBUG */ 01299 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void sync_print | ( | FILE * | file | ) |
Definition at line 1353 of file sync0sync.c.
References sync_array_print_info(), sync_primary_wait_array, and sync_print_wait_info().
Referenced by srv_printf_innodb_monitor().
01355 : file where to print */ 01356 { 01357 #ifdef UNIV_SYNC_DEBUG 01358 mutex_list_print_info(); 01359 01360 rw_lock_list_print_info(); 01361 #endif /* UNIV_SYNC_DEBUG */ 01362 01363 sync_array_print_info(file, sync_primary_wait_array); 01364 01365 sync_print_wait_info(file); 01366 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void sync_print_wait_info | ( | FILE * | file | ) |
Definition at line 1328 of file sync0sync.c.
References mutex_exit_count, mutex_os_wait_count, mutex_spin_round_count, mutex_spin_wait_count, rw_s_exit_count, rw_s_os_wait_count, rw_s_spin_wait_count, rw_x_exit_count, rw_x_os_wait_count, and rw_x_spin_wait_count.
Referenced by sync_print().
01330 : file where to print */ 01331 { 01332 #ifdef UNIV_SYNC_DEBUG 01333 fprintf(stderr, "Mutex exits %lu, rws exits %lu, rwx exits %lu\n", 01334 mutex_exit_count, rw_s_exit_count, rw_x_exit_count); 01335 #endif 01336 01337 fprintf(file, 01338 "Mutex spin waits %lu, rounds %lu, OS waits %lu\n" 01339 "RW-shared spins %lu, OS waits %lu; RW-excl spins %lu, OS waits %lu\n", 01340 (ulong) mutex_spin_wait_count, 01341 (ulong) mutex_spin_round_count, 01342 (ulong) mutex_os_wait_count, 01343 (ulong) rw_s_spin_wait_count, 01344 (ulong) rw_s_os_wait_count, 01345 (ulong) rw_x_spin_wait_count, 01346 (ulong) rw_x_os_wait_count); 01347 }
Here is the caller graph for this function:

| void sync_thread_add_level | ( | void * | latch, | |
| ulint | level | |||
| ) |
Definition at line 967 of file sync0sync.c.
References sync_thread_struct::id, sync_level_struct::latch, sync_level_struct::level, sync_thread_struct::levels, mutex_enter, mutex_list_mutex, NULL, os_thread_get_curr_id(), rw_lock_list_mutex, SYNC_ANY_LATCH, SYNC_BUF_BLOCK, SYNC_BUF_POOL, SYNC_DICT, SYNC_DICT_AUTOINC_MUTEX, SYNC_DICT_HEADER, SYNC_DICT_OPERATION, SYNC_DOUBLEWRITE, SYNC_EXTERN_STORAGE, SYNC_FSP, SYNC_FSP_PAGE, SYNC_IBUF_BITMAP, SYNC_IBUF_BITMAP_MUTEX, SYNC_IBUF_HEADER, SYNC_IBUF_MUTEX, SYNC_IBUF_PESS_INSERT_MUTEX, SYNC_INDEX_TREE, SYNC_KERNEL, SYNC_LEVEL_VARYING, SYNC_LOG, SYNC_MEM_HASH, SYNC_MEM_POOL, SYNC_NO_ORDER_CHECK, sync_order_checks_on, SYNC_PURGE_LATCH, SYNC_PURGE_SYS, SYNC_REC_LOCK, SYNC_RECV, SYNC_RSEG, SYNC_RSEG_HEADER, SYNC_RSEG_HEADER_NEW, SYNC_SEARCH_SYS, SYNC_THR_LOCAL, sync_thread_level_arrays_find_free(), sync_thread_level_arrays_find_slot(), sync_thread_levels_contain(), sync_thread_levels_g(), sync_thread_levels_get_nth(), sync_thread_mutex, SYNC_THREAD_N_LEVELS, SYNC_TREE_NODE, SYNC_TREE_NODE_FROM_HASH, SYNC_TREE_NODE_NEW, SYNC_TRX_LOCK_HEAP, SYNC_TRX_SYS_HEADER, SYNC_TRX_UNDO, SYNC_TRX_UNDO_PAGE, SYNC_WORK_QUEUE, ut_a, ut_error, and ut_malloc().
00969 : pointer to a mutex or an rw-lock */ 00970 ulint level) /* in: level in the latching order; if 00971 SYNC_LEVEL_VARYING, nothing is done */ 00972 { 00973 sync_level_t* array; 00974 sync_level_t* slot; 00975 sync_thread_t* thread_slot; 00976 ulint i; 00977 00978 if (!sync_order_checks_on) { 00979 00980 return; 00981 } 00982 00983 if ((latch == (void*)&sync_thread_mutex) 00984 || (latch == (void*)&mutex_list_mutex) 00985 #ifdef UNIV_SYNC_DEBUG 00986 || (latch == (void*)&rw_lock_debug_mutex) 00987 #endif /* UNIV_SYNC_DEBUG */ 00988 || (latch == (void*)&rw_lock_list_mutex)) { 00989 00990 return; 00991 } 00992 00993 if (level == SYNC_LEVEL_VARYING) { 00994 00995 return; 00996 } 00997 00998 mutex_enter(&sync_thread_mutex); 00999 01000 thread_slot = sync_thread_level_arrays_find_slot(); 01001 01002 if (thread_slot == NULL) { 01003 /* We have to allocate the level array for a new thread */ 01004 array = ut_malloc(sizeof(sync_level_t) * SYNC_THREAD_N_LEVELS); 01005 01006 thread_slot = sync_thread_level_arrays_find_free(); 01007 01008 thread_slot->id = os_thread_get_curr_id(); 01009 thread_slot->levels = array; 01010 01011 for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) { 01012 01013 slot = sync_thread_levels_get_nth(array, i); 01014 01015 slot->latch = NULL; 01016 } 01017 } 01018 01019 array = thread_slot->levels; 01020 01021 /* NOTE that there is a problem with _NODE and _LEAF levels: if the 01022 B-tree height changes, then a leaf can change to an internal node 01023 or the other way around. We do not know at present if this can cause 01024 unnecessary assertion failures below. */ 01025 01026 switch (level) { 01027 case SYNC_NO_ORDER_CHECK: 01028 case SYNC_EXTERN_STORAGE: 01029 case SYNC_TREE_NODE_FROM_HASH: 01030 /* Do no order checking */ 01031 break; 01032 case SYNC_MEM_POOL: 01033 ut_a(sync_thread_levels_g(array, SYNC_MEM_POOL)); 01034 break; 01035 case SYNC_MEM_HASH: 01036 ut_a(sync_thread_levels_g(array, SYNC_MEM_HASH)); 01037 break; 01038 case SYNC_RECV: 01039 ut_a(sync_thread_levels_g(array, SYNC_RECV)); 01040 break; 01041 case SYNC_WORK_QUEUE: 01042 ut_a(sync_thread_levels_g(array, SYNC_WORK_QUEUE)); 01043 break; 01044 case SYNC_LOG: 01045 ut_a(sync_thread_levels_g(array, SYNC_LOG)); 01046 break; 01047 case SYNC_THR_LOCAL: 01048 ut_a(sync_thread_levels_g(array, SYNC_THR_LOCAL)); 01049 break; 01050 case SYNC_ANY_LATCH: 01051 ut_a(sync_thread_levels_g(array, SYNC_ANY_LATCH)); 01052 break; 01053 case SYNC_TRX_SYS_HEADER: 01054 ut_a(sync_thread_levels_g(array, SYNC_TRX_SYS_HEADER)); 01055 break; 01056 case SYNC_DOUBLEWRITE: 01057 ut_a(sync_thread_levels_g(array, SYNC_DOUBLEWRITE)); 01058 break; 01059 case SYNC_BUF_BLOCK: 01060 ut_a((sync_thread_levels_contain(array, SYNC_BUF_POOL) 01061 && sync_thread_levels_g(array, SYNC_BUF_BLOCK - 1)) 01062 || sync_thread_levels_g(array, SYNC_BUF_BLOCK)); 01063 break; 01064 case SYNC_BUF_POOL: 01065 ut_a(sync_thread_levels_g(array, SYNC_BUF_POOL)); 01066 break; 01067 case SYNC_SEARCH_SYS: 01068 ut_a(sync_thread_levels_g(array, SYNC_SEARCH_SYS)); 01069 break; 01070 case SYNC_TRX_LOCK_HEAP: 01071 ut_a(sync_thread_levels_g(array, SYNC_TRX_LOCK_HEAP)); 01072 break; 01073 case SYNC_REC_LOCK: 01074 ut_a((sync_thread_levels_contain(array, SYNC_KERNEL) 01075 && sync_thread_levels_g(array, SYNC_REC_LOCK - 1)) 01076 || sync_thread_levels_g(array, SYNC_REC_LOCK)); 01077 break; 01078 case SYNC_KERNEL: 01079 ut_a(sync_thread_levels_g(array, SYNC_KERNEL)); 01080 break; 01081 case SYNC_IBUF_BITMAP: 01082 ut_a((sync_thread_levels_contain(array, SYNC_IBUF_BITMAP_MUTEX) 01083 && sync_thread_levels_g(array, SYNC_IBUF_BITMAP - 1)) 01084 || sync_thread_levels_g(array, SYNC_IBUF_BITMAP)); 01085 break; 01086 case SYNC_IBUF_BITMAP_MUTEX: 01087 ut_a(sync_thread_levels_g(array, SYNC_IBUF_BITMAP_MUTEX)); 01088 break; 01089 case SYNC_FSP_PAGE: 01090 ut_a(sync_thread_levels_contain(array, SYNC_FSP)); 01091 break; 01092 case SYNC_FSP: 01093 ut_a(sync_thread_levels_contain(array, SYNC_FSP) 01094 || sync_thread_levels_g(array, SYNC_FSP)); 01095 break; 01096 case SYNC_TRX_UNDO_PAGE: 01097 ut_a(sync_thread_levels_contain(array, SYNC_TRX_UNDO) 01098 || sync_thread_levels_contain(array, SYNC_RSEG) 01099 || sync_thread_levels_contain(array, SYNC_PURGE_SYS) 01100 || sync_thread_levels_g(array, SYNC_TRX_UNDO_PAGE)); 01101 break; 01102 case SYNC_RSEG_HEADER: 01103 ut_a(sync_thread_levels_contain(array, SYNC_RSEG)); 01104 break; 01105 case SYNC_RSEG_HEADER_NEW: 01106 ut_a(sync_thread_levels_contain(array, SYNC_KERNEL) 01107 && sync_thread_levels_contain(array, SYNC_FSP_PAGE)); 01108 break; 01109 case SYNC_RSEG: 01110 ut_a(sync_thread_levels_g(array, SYNC_RSEG)); 01111 break; 01112 case SYNC_TRX_UNDO: 01113 ut_a(sync_thread_levels_g(array, SYNC_TRX_UNDO)); 01114 break; 01115 case SYNC_PURGE_LATCH: 01116 ut_a(sync_thread_levels_g(array, SYNC_PURGE_LATCH)); 01117 break; 01118 case SYNC_PURGE_SYS: 01119 ut_a(sync_thread_levels_g(array, SYNC_PURGE_SYS)); 01120 break; 01121 case SYNC_TREE_NODE: 01122 ut_a(sync_thread_levels_contain(array, SYNC_INDEX_TREE) 01123 || sync_thread_levels_g(array, SYNC_TREE_NODE - 1)); 01124 break; 01125 case SYNC_TREE_NODE_NEW: 01126 ut_a(sync_thread_levels_contain(array, SYNC_FSP_PAGE) 01127 || sync_thread_levels_contain(array, SYNC_IBUF_MUTEX)); 01128 break; 01129 case SYNC_INDEX_TREE: 01130 ut_a((sync_thread_levels_contain(array, SYNC_IBUF_MUTEX) 01131 && sync_thread_levels_contain(array, SYNC_FSP) 01132 && sync_thread_levels_g(array, SYNC_FSP_PAGE - 1)) 01133 || sync_thread_levels_g(array, SYNC_TREE_NODE - 1)); 01134 break; 01135 case SYNC_IBUF_MUTEX: 01136 ut_a(sync_thread_levels_g(array, SYNC_FSP_PAGE - 1)); 01137 break; 01138 case SYNC_IBUF_PESS_INSERT_MUTEX: 01139 ut_a(sync_thread_levels_g(array, SYNC_FSP - 1) 01140 && !sync_thread_levels_contain(array, SYNC_IBUF_MUTEX)); 01141 break; 01142 case SYNC_IBUF_HEADER: 01143 ut_a(sync_thread_levels_g(array, SYNC_FSP - 1) 01144 && !sync_thread_levels_contain(array, SYNC_IBUF_MUTEX) 01145 && !sync_thread_levels_contain(array, 01146 SYNC_IBUF_PESS_INSERT_MUTEX)); 01147 break; 01148 case SYNC_DICT_AUTOINC_MUTEX: 01149 ut_a(sync_thread_levels_g(array, SYNC_DICT_AUTOINC_MUTEX)); 01150 break; 01151 case SYNC_DICT_OPERATION: 01152 ut_a(sync_thread_levels_g(array, SYNC_DICT_OPERATION)); 01153 break; 01154 case SYNC_DICT_HEADER: 01155 ut_a(sync_thread_levels_g(array, SYNC_DICT_HEADER)); 01156 break; 01157 case SYNC_DICT: 01158 #ifdef UNIV_DEBUG 01159 ut_a(buf_debug_prints 01160 || sync_thread_levels_g(array, SYNC_DICT)); 01161 #else /* UNIV_DEBUG */ 01162 ut_a(sync_thread_levels_g(array, SYNC_DICT)); 01163 #endif /* UNIV_DEBUG */ 01164 break; 01165 default: 01166 ut_error; 01167 } 01168 01169 for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) { 01170 01171 slot = sync_thread_levels_get_nth(array, i); 01172 01173 if (slot->latch == NULL) { 01174 slot->latch = latch; 01175 slot->level = level; 01176 01177 break; 01178 } 01179 } 01180 01181 ut_a(i < SYNC_THREAD_N_LEVELS); 01182 01183 mutex_exit(&sync_thread_mutex); 01184 }
Here is the call graph for this function:

| ibool sync_thread_levels_empty | ( | void | ) |
Definition at line 954 of file sync0sync.c.
References FALSE, and sync_thread_levels_empty_gen().
00956 : TRUE if empty */ 00957 { 00958 return(sync_thread_levels_empty_gen(FALSE)); 00959 }
Here is the call graph for this function:

| ibool sync_thread_levels_empty_gen | ( | ibool | dict_mutex_allowed | ) |
Definition at line 898 of file sync0sync.c.
References FALSE, sync_level_struct::latch, sync_level_struct::level, sync_thread_struct::levels, mutex_enter, mutex_exit(), NULL, SYNC_DICT, SYNC_DICT_OPERATION, sync_order_checks_on, sync_thread_level_arrays_find_slot(), sync_thread_levels_get_nth(), sync_thread_mutex, SYNC_THREAD_N_LEVELS, TRUE, and ut_error.
Referenced by buf_flush_batch(), row_sel(), and sync_thread_levels_empty().
00900 : TRUE if empty except the 00901 exceptions specified below */ 00902 ibool dict_mutex_allowed) /* in: TRUE if dictionary mutex is 00903 allowed to be owned by the thread, 00904 also purge_is_running mutex is 00905 allowed */ 00906 { 00907 sync_level_t* arr; 00908 sync_thread_t* thread_slot; 00909 sync_level_t* slot; 00910 ulint i; 00911 00912 if (!sync_order_checks_on) { 00913 00914 return(TRUE); 00915 } 00916 00917 mutex_enter(&sync_thread_mutex); 00918 00919 thread_slot = sync_thread_level_arrays_find_slot(); 00920 00921 if (thread_slot == NULL) { 00922 00923 mutex_exit(&sync_thread_mutex); 00924 00925 return(TRUE); 00926 } 00927 00928 arr = thread_slot->levels; 00929 00930 for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) { 00931 00932 slot = sync_thread_levels_get_nth(arr, i); 00933 00934 if (slot->latch != NULL && (!dict_mutex_allowed || 00935 (slot->level != SYNC_DICT 00936 && slot->level != SYNC_DICT_OPERATION))) { 00937 00938 mutex_exit(&sync_thread_mutex); 00939 ut_error; 00940 00941 return(FALSE); 00942 } 00943 } 00944 00945 mutex_exit(&sync_thread_mutex); 00946 00947 return(TRUE); 00948 }
Here is the call graph for this function:

Here is the caller graph for this function:

| ibool sync_thread_reset_level | ( | void * | latch | ) |
Definition at line 1190 of file sync0sync.c.
References FALSE, sync_level_struct::latch, sync_thread_struct::levels, mutex_enter, mutex_exit(), mutex_list_mutex, NULL, rw_lock_list_mutex, sync_order_checks_on, sync_thread_level_arrays_find_slot(), sync_thread_levels_get_nth(), sync_thread_mutex, SYNC_THREAD_N_LEVELS, TRUE, and ut_error.
01192 : TRUE if found from the array; it is an error 01193 if the latch is not found */ 01194 void* latch) /* in: pointer to a mutex or an rw-lock */ 01195 { 01196 sync_level_t* array; 01197 sync_level_t* slot; 01198 sync_thread_t* thread_slot; 01199 ulint i; 01200 01201 if (!sync_order_checks_on) { 01202 01203 return(FALSE); 01204 } 01205 01206 if ((latch == (void*)&sync_thread_mutex) 01207 || (latch == (void*)&mutex_list_mutex) 01208 #ifdef UNIV_SYNC_DEBUG 01209 || (latch == (void*)&rw_lock_debug_mutex) 01210 #endif /* UNIV_SYNC_DEBUG */ 01211 || (latch == (void*)&rw_lock_list_mutex)) { 01212 01213 return(FALSE); 01214 } 01215 01216 mutex_enter(&sync_thread_mutex); 01217 01218 thread_slot = sync_thread_level_arrays_find_slot(); 01219 01220 if (thread_slot == NULL) { 01221 01222 ut_error; 01223 01224 mutex_exit(&sync_thread_mutex); 01225 return(FALSE); 01226 } 01227 01228 array = thread_slot->levels; 01229 01230 for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) { 01231 01232 slot = sync_thread_levels_get_nth(array, i); 01233 01234 if (slot->latch == latch) { 01235 slot->latch = NULL; 01236 01237 mutex_exit(&sync_thread_mutex); 01238 01239 return(TRUE); 01240 } 01241 } 01242 01243 ut_error; 01244 01245 mutex_exit(&sync_thread_mutex); 01246 01247 return(FALSE); 01248 }
Here is the call graph for this function:

| typedef UT_LIST_BASE_NODE_T | ( | mutex_t | ) |
| ut_list_base_node_t mutex_list |
Definition at line 145 of file sync0sync.c.
Referenced by mutex_create_func(), mutex_free(), sync_close(), and sync_init().
Definition at line 148 of file sync0sync.c.
Referenced by mutex_create_func(), mutex_free(), sync_close(), sync_init(), sync_thread_add_level(), and sync_thread_reset_level().
| ibool sync_initialized |
| ibool sync_order_checks_on |
Definition at line 151 of file sync0sync.c.
Referenced by innobase_start_or_create_for_mysql(), sync_thread_add_level(), sync_thread_levels_empty_gen(), and sync_thread_reset_level().
Definition at line 127 of file sync0sync.c.
Referenced by mutex_signal_object(), mutex_spin_wait(), rw_lock_s_lock_spin(), rw_lock_x_lock_func(), sync_arr_wake_threads_if_sema_free(), sync_array_print_long_waits(), sync_close(), sync_init(), and sync_print().
Definition at line 28 of file my_static.c.
1.4.7

