37 #ifndef UNIV_HOTBACKUP
91 #ifndef UNIV_HOTBACKUP
96 #define X_LOCK_DECR 0x00100000
99 #ifdef UNIV_SYNC_DEBUG
100 struct rw_lock_debug_t;
103 typedef UT_LIST_BASE_NODE_T(
rw_lock_t) rw_lock_list_t;
105 extern rw_lock_list_t rw_lock_list;
108 #ifdef UNIV_SYNC_DEBUG
117 extern ibool rw_lock_debug_waiters;
124 #ifdef UNIV_PFS_RWLOCK
127 # ifdef UNIV_LOG_ARCHIVE
128 extern mysql_pfs_key_t archive_lock_key;
130 extern mysql_pfs_key_t btr_search_latch_key;
131 extern mysql_pfs_key_t buf_block_lock_key;
132 # ifdef UNIV_SYNC_DEBUG
133 extern mysql_pfs_key_t buf_block_debug_latch_key;
135 extern mysql_pfs_key_t dict_operation_lock_key;
136 extern mysql_pfs_key_t checkpoint_lock_key;
137 extern mysql_pfs_key_t fil_space_latch_key;
138 extern mysql_pfs_key_t fts_cache_rw_lock_key;
139 extern mysql_pfs_key_t fts_cache_init_rw_lock_key;
140 extern mysql_pfs_key_t trx_i_s_cache_lock_key;
141 extern mysql_pfs_key_t trx_purge_latch_key;
142 extern mysql_pfs_key_t index_tree_rw_lock_key;
143 extern mysql_pfs_key_t index_online_log_key;
144 extern mysql_pfs_key_t dict_table_stats_latch_key;
145 extern mysql_pfs_key_t trx_sys_rw_lock_key;
146 extern mysql_pfs_key_t hash_table_rw_lock_key;
150 #ifndef UNIV_PFS_RWLOCK
159 # ifdef UNIV_SYNC_DEBUG
160 # define rw_lock_create(K, L, level) \
161 rw_lock_create_func((L), (level), #L, __FILE__, __LINE__)
163 # define rw_lock_create(K, L, level) \
164 rw_lock_create_func((L), #L, __FILE__, __LINE__)
167 # define rw_lock_create(K, L, level) \
168 rw_lock_create_func((L), __FILE__, __LINE__)
175 # define rw_lock_s_lock(M) \
176 rw_lock_s_lock_func((M), 0, __FILE__, __LINE__)
178 # define rw_lock_s_lock_inline(M, P, F, L) \
179 rw_lock_s_lock_func((M), (P), (F), (L))
181 # define rw_lock_s_lock_gen(M, P) \
182 rw_lock_s_lock_func((M), (P), __FILE__, __LINE__)
184 # define rw_lock_s_lock_nowait(M, F, L) \
185 rw_lock_s_lock_low((M), 0, (F), (L))
187 # ifdef UNIV_SYNC_DEBUG
188 # define rw_lock_s_unlock_gen(L, P) rw_lock_s_unlock_func(P, L)
190 # define rw_lock_s_unlock_gen(L, P) rw_lock_s_unlock_func(L)
194 # define rw_lock_x_lock(M) \
195 rw_lock_x_lock_func((M), 0, __FILE__, __LINE__)
197 # define rw_lock_x_lock_inline(M, P, F, L) \
198 rw_lock_x_lock_func((M), (P), (F), (L))
200 # define rw_lock_x_lock_gen(M, P) \
201 rw_lock_x_lock_func((M), (P), __FILE__, __LINE__)
203 # define rw_lock_x_lock_nowait(M) \
204 rw_lock_x_lock_func_nowait((M), __FILE__, __LINE__)
206 # define rw_lock_x_lock_func_nowait_inline(M, F, L) \
207 rw_lock_x_lock_func_nowait((M), (F), (L))
209 # ifdef UNIV_SYNC_DEBUG
210 # define rw_lock_x_unlock_gen(L, P) rw_lock_x_unlock_func(P, L)
212 # define rw_lock_x_unlock_gen(L, P) rw_lock_x_unlock_func(L)
215 # define rw_lock_free(M) rw_lock_free_func(M)
221 # ifdef UNIV_SYNC_DEBUG
222 # define rw_lock_create(K, L, level) \
223 pfs_rw_lock_create_func((K), (L), (level), #L, __FILE__, __LINE__)
225 # define rw_lock_create(K, L, level) \
226 pfs_rw_lock_create_func((K), (L), #L, __FILE__, __LINE__)
229 # define rw_lock_create(K, L, level) \
230 pfs_rw_lock_create_func((K), (L), __FILE__, __LINE__)
237 # define rw_lock_s_lock(M) \
238 pfs_rw_lock_s_lock_func((M), 0, __FILE__, __LINE__)
240 # define rw_lock_s_lock_inline(M, P, F, L) \
241 pfs_rw_lock_s_lock_func((M), (P), (F), (L))
243 # define rw_lock_s_lock_gen(M, P) \
244 pfs_rw_lock_s_lock_func((M), (P), __FILE__, __LINE__)
246 # define rw_lock_s_lock_nowait(M, F, L) \
247 pfs_rw_lock_s_lock_low((M), 0, (F), (L))
249 # ifdef UNIV_SYNC_DEBUG
250 # define rw_lock_s_unlock_gen(L, P) pfs_rw_lock_s_unlock_func(P, L)
252 # define rw_lock_s_unlock_gen(L, P) pfs_rw_lock_s_unlock_func(L)
255 # define rw_lock_x_lock(M) \
256 pfs_rw_lock_x_lock_func((M), 0, __FILE__, __LINE__)
258 # define rw_lock_x_lock_inline(M, P, F, L) \
259 pfs_rw_lock_x_lock_func((M), (P), (F), (L))
261 # define rw_lock_x_lock_gen(M, P) \
262 pfs_rw_lock_x_lock_func((M), (P), __FILE__, __LINE__)
264 # define rw_lock_x_lock_nowait(M) \
265 pfs_rw_lock_x_lock_func_nowait((M), __FILE__, __LINE__)
267 # define rw_lock_x_lock_func_nowait_inline(M, F, L) \
268 pfs_rw_lock_x_lock_func_nowait((M), (F), (L))
270 # ifdef UNIV_SYNC_DEBUG
271 # define rw_lock_x_unlock_gen(L, P) pfs_rw_lock_x_unlock_func(P, L)
273 # define rw_lock_x_unlock_gen(L, P) pfs_rw_lock_x_unlock_func(L)
276 # define rw_lock_free(M) pfs_rw_lock_free_func(M)
280 #define rw_lock_s_unlock(L) rw_lock_s_unlock_gen(L, 0)
281 #define rw_lock_x_unlock(L) rw_lock_x_unlock_gen(L, 0)
294 # ifdef UNIV_SYNC_DEBUG
297 const char* cmutex_name,
299 const char* cfile_name,
330 ulint pass __attribute__((unused)),
333 const char* file_name,
349 const char* file_name,
361 const char* file_name,
369 #ifdef UNIV_SYNC_DEBUG
391 const char* file_name,
399 #ifdef UNIV_SYNC_DEBUG
487 #ifdef UNIV_SYNC_DEBUG
498 __attribute__((warn_unused_result));
509 #ifdef UNIV_SYNC_DEBUG
521 rw_lock_list_print_info(
530 rw_lock_n_locked(
void);
543 rw_lock_debug_mutex_enter(
void);
549 rw_lock_debug_mutex_exit(
void);
558 rw_lock_debug_t* info);
595 #ifndef INNODB_RW_LOCKS_USE_ATOMICS
602 #ifdef UNIV_SYNC_DEBUG
603 UT_LIST_BASE_NODE_T(rw_lock_debug_t) debug_list;
608 #ifdef UNIV_PFS_RWLOCK
609 struct PSI_rwlock *pfs_psi;
629 #define RW_LOCK_MAGIC_N 22643
633 #ifdef UNIV_SYNC_DEBUG
636 struct rw_lock_debug_t {
643 const char* file_name;
675 #ifdef UNIV_PFS_RWLOCK
682 pfs_rw_lock_create_func(
688 # ifdef UNIV_SYNC_DEBUG
691 const char* cmutex_name,
693 const char* cfile_name,
702 pfs_rw_lock_x_lock_func(
707 const char* file_name,
716 pfs_rw_lock_x_lock_func_nowait(
719 const char* file_name,
727 pfs_rw_lock_s_lock_func(
732 const char* file_name,
741 pfs_rw_lock_s_lock_low(
747 const char* file_name,
755 pfs_rw_lock_x_lock_func(
760 const char* file_name,
768 pfs_rw_lock_s_unlock_func(
770 #ifdef UNIV_SYNC_DEBUG
782 pfs_rw_lock_x_unlock_func(
784 #ifdef UNIV_SYNC_DEBUG
796 pfs_rw_lock_free_func(
803 #include "sync0rw.ic"