37 #ifndef UNIV_HOTBACKUP
91 #ifndef UNIV_HOTBACKUP
96 #define X_LOCK_DECR 0x00100000
99 #ifdef UNIV_SYNC_DEBUG
105 extern rw_lock_list_t rw_lock_list;
108 #ifdef UNIV_SYNC_DEBUG
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_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_gen_nowait(M, P) \
185 rw_lock_s_lock_low((M), (P), __FILE__, __LINE__)
187 # define rw_lock_s_lock_nowait(M, F, L) \
188 rw_lock_s_lock_low((M), 0, (F), (L))
190 # ifdef UNIV_SYNC_DEBUG
191 # define rw_lock_s_unlock_gen(L, P) rw_lock_s_unlock_func(P, L)
193 # define rw_lock_s_unlock_gen(L, P) rw_lock_s_unlock_func(L)
197 # define rw_lock_x_lock(M) \
198 rw_lock_x_lock_func((M), 0, __FILE__, __LINE__)
200 # define rw_lock_x_lock_inline(M, P, F, L) \
201 rw_lock_x_lock_func((M), (P), (F), (L))
203 # define rw_lock_x_lock_gen(M, P) \
204 rw_lock_x_lock_func((M), (P), __FILE__, __LINE__)
206 # define rw_lock_x_lock_nowait(M) \
207 rw_lock_x_lock_func_nowait((M), __FILE__, __LINE__)
209 # define rw_lock_x_lock_func_nowait_inline(M, F, L) \
210 rw_lock_x_lock_func_nowait((M), (F), (L))
212 # ifdef UNIV_SYNC_DEBUG
213 # define rw_lock_x_unlock_gen(L, P) rw_lock_x_unlock_func(P, L)
215 # define rw_lock_x_unlock_gen(L, P) rw_lock_x_unlock_func(L)
218 # define rw_lock_free(M) rw_lock_free_func(M)
224 # ifdef UNIV_SYNC_DEBUG
225 # define rw_lock_create(K, L, level) \
226 pfs_rw_lock_create_func((K), (L), (level), #L, __FILE__, __LINE__)
228 # define rw_lock_create(K, L, level) \
229 pfs_rw_lock_create_func((K), (L), #L, __FILE__, __LINE__)
232 # define rw_lock_create(K, L, level) \
233 pfs_rw_lock_create_func((K), (L), __FILE__, __LINE__)
240 # define rw_lock_s_lock(M) \
241 pfs_rw_lock_s_lock_func((M), 0, __FILE__, __LINE__)
243 # define rw_lock_s_lock_inline(M, P, F, L) \
244 pfs_rw_lock_s_lock_func((M), (P), (F), (L))
246 # define rw_lock_s_lock_gen(M, P) \
247 pfs_rw_lock_s_lock_func((M), (P), __FILE__, __LINE__)
249 # define rw_lock_s_lock_gen_nowait(M, P) \
250 pfs_rw_lock_s_lock_low((M), (P), __FILE__, __LINE__)
252 # define rw_lock_s_lock_nowait(M, F, L) \
253 pfs_rw_lock_s_lock_low((M), 0, (F), (L))
255 # ifdef UNIV_SYNC_DEBUG
256 # define rw_lock_s_unlock_gen(L, P) pfs_rw_lock_s_unlock_func(P, L)
258 # define rw_lock_s_unlock_gen(L, P) pfs_rw_lock_s_unlock_func(L)
261 # define rw_lock_x_lock(M) \
262 pfs_rw_lock_x_lock_func((M), 0, __FILE__, __LINE__)
264 # define rw_lock_x_lock_inline(M, P, F, L) \
265 pfs_rw_lock_x_lock_func((M), (P), (F), (L))
267 # define rw_lock_x_lock_gen(M, P) \
268 pfs_rw_lock_x_lock_func((M), (P), __FILE__, __LINE__)
270 # define rw_lock_x_lock_nowait(M) \
271 pfs_rw_lock_x_lock_func_nowait((M), __FILE__, __LINE__)
273 # define rw_lock_x_lock_func_nowait_inline(M, F, L) \
274 pfs_rw_lock_x_lock_func_nowait((M), (F), (L))
276 # ifdef UNIV_SYNC_DEBUG
277 # define rw_lock_x_unlock_gen(L, P) pfs_rw_lock_x_unlock_func(P, L)
279 # define rw_lock_x_unlock_gen(L, P) pfs_rw_lock_x_unlock_func(L)
282 # define rw_lock_free(M) pfs_rw_lock_free_func(M)
286 #define rw_lock_s_unlock(L) rw_lock_s_unlock_gen(L, 0)
287 #define rw_lock_x_unlock(L) rw_lock_x_unlock_gen(L, 0)
300 # ifdef UNIV_SYNC_DEBUG
303 const char* cmutex_name,
305 const char* cfile_name,
336 ulint
pass __attribute__((unused)),
375 #ifdef UNIV_SYNC_DEBUG
405 #ifdef UNIV_SYNC_DEBUG
493 #ifdef UNIV_SYNC_DEBUG
504 __attribute__((warn_unused_result));
515 #ifdef UNIV_SYNC_DEBUG
601 #ifndef INNODB_RW_LOCKS_USE_ATOMICS
608 #ifdef UNIV_SYNC_DEBUG
614 #ifdef UNIV_PFS_RWLOCK
615 struct PSI_rwlock *pfs_psi;
635 #define RW_LOCK_MAGIC_N 22643
639 #ifdef UNIV_SYNC_DEBUG
681 #ifdef UNIV_PFS_RWLOCK
688 pfs_rw_lock_create_func(
694 # ifdef UNIV_SYNC_DEBUG
697 const char* cmutex_name,
699 const char* cfile_name,
708 pfs_rw_lock_x_lock_func(
722 pfs_rw_lock_x_lock_func_nowait(
733 pfs_rw_lock_s_lock_func(
747 pfs_rw_lock_s_lock_low(
761 pfs_rw_lock_x_lock_func(
774 pfs_rw_lock_s_unlock_func(
776 #ifdef UNIV_SYNC_DEBUG
788 pfs_rw_lock_x_unlock_func(
790 #ifdef UNIV_SYNC_DEBUG
802 pfs_rw_lock_free_func(