Commit 581aebe2 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24167: Fix -DPLUGIN_PERFSCHEMA=NO and Windows debug builds

parent 4e359eb8
...@@ -1038,7 +1038,7 @@ void dict_sys_t::create() ...@@ -1038,7 +1038,7 @@ void dict_sys_t::create()
table_id_hash.create(hash_size); table_id_hash.create(hash_size);
temp_id_hash.create(hash_size); temp_id_hash.create(hash_size);
latch.init(dict_operation_lock_key); latch.SRW_LOCK_INIT(dict_operation_lock_key);
if (!srv_read_only_mode) if (!srv_read_only_mode)
{ {
......
...@@ -957,7 +957,7 @@ fil_space_t *fil_space_t::create(const char *name, ulint id, ulint flags, ...@@ -957,7 +957,7 @@ fil_space_t *fil_space_t::create(const char *name, ulint id, ulint flags,
<< " " << fil_crypt_get_type(crypt_data)); << " " << fil_crypt_get_type(crypt_data));
} }
space->latch.init(fil_space_latch_key); space->latch.SRW_LOCK_INIT(fil_space_latch_key);
if (space->purpose == FIL_TYPE_TEMPORARY) { if (space->purpose == FIL_TYPE_TEMPORARY) {
/* SysTablespace::open_or_create() would pass /* SysTablespace::open_or_create() would pass
......
...@@ -250,7 +250,7 @@ struct btr_search_sys_t ...@@ -250,7 +250,7 @@ struct btr_search_sys_t
void init() void init()
{ {
memset((void*) this, 0, sizeof *this); memset((void*) this, 0, sizeof *this);
latch.init(btr_search_latch_key); latch.SRW_LOCK_INIT(btr_search_latch_key);
} }
void alloc(ulint hash_size) void alloc(ulint hash_size)
......
...@@ -32,6 +32,12 @@ this program; if not, write to the Free Software Foundation, Inc., ...@@ -32,6 +32,12 @@ this program; if not, write to the Free Software Foundation, Inc.,
# endif # endif
#endif #endif
#ifdef UNIV_PFS_RWLOCK
# define SRW_LOCK_INIT(key) init(key)
#else
# define SRW_LOCK_INIT(key) init()
#endif
class srw_lock final class srw_lock final
#if defined __linux__ && !defined SRW_LOCK_DUMMY #if defined __linux__ && !defined SRW_LOCK_DUMMY
: protected rw_lock : protected rw_lock
...@@ -40,7 +46,7 @@ class srw_lock final ...@@ -40,7 +46,7 @@ class srw_lock final
#if defined SRW_LOCK_DUMMY || (!defined _WIN32 && !defined __linux__) #if defined SRW_LOCK_DUMMY || (!defined _WIN32 && !defined __linux__)
mysql_rwlock_t lock; mysql_rwlock_t lock;
public: public:
void init(mysql_pfs_key_t key) { mysql_rwlock_init(key, &lock); } void SRW_LOCK_INIT(mysql_pfs_key_t key) { mysql_rwlock_init(key, &lock); }
void destroy() { mysql_rwlock_destroy(&lock); } void destroy() { mysql_rwlock_destroy(&lock); }
void rd_lock() { mysql_rwlock_rdlock(&lock); } void rd_lock() { mysql_rwlock_rdlock(&lock); }
void rd_unlock() { mysql_rwlock_unlock(&lock); } void rd_unlock() { mysql_rwlock_unlock(&lock); }
...@@ -67,7 +73,7 @@ class srw_lock final ...@@ -67,7 +73,7 @@ class srw_lock final
# endif # endif
public: public:
void init(mysql_pfs_key_t key) void SRW_LOCK_INIT(mysql_pfs_key_t key)
{ {
# ifdef UNIV_PFS_RWLOCK # ifdef UNIV_PFS_RWLOCK
pfs_psi= PSI_RWLOCK_CALL(init_rwlock)(key, this); pfs_psi= PSI_RWLOCK_CALL(init_rwlock)(key, this);
...@@ -83,7 +89,7 @@ class srw_lock final ...@@ -83,7 +89,7 @@ class srw_lock final
pfs_psi= nullptr; pfs_psi= nullptr;
} }
# endif # endif
DBUG_ASSERT(!is_locked_or_waiting()); IF_WIN(, DBUG_ASSERT(!is_locked_or_waiting()));
} }
void rd_lock() void rd_lock()
{ {
......
...@@ -1263,7 +1263,7 @@ trx_i_s_cache_init( ...@@ -1263,7 +1263,7 @@ trx_i_s_cache_init(
acquire trx_i_s_cache_t::rw_lock, rdlock acquire trx_i_s_cache_t::rw_lock, rdlock
release trx_i_s_cache_t::rw_lock */ release trx_i_s_cache_t::rw_lock */
cache->rw_lock.init(trx_i_s_cache_lock_key); cache->rw_lock.SRW_LOCK_INIT(trx_i_s_cache_lock_key);
cache->last_read = 0; cache->last_read = 0;
......
...@@ -175,7 +175,7 @@ void purge_sys_t::create() ...@@ -175,7 +175,7 @@ void purge_sys_t::create()
offset= 0; offset= 0;
hdr_page_no= 0; hdr_page_no= 0;
hdr_offset= 0; hdr_offset= 0;
latch.init(trx_purge_latch_key); latch.SRW_LOCK_INIT(trx_purge_latch_key);
mutex_create(LATCH_ID_PURGE_SYS_PQ, &pq_mutex); mutex_create(LATCH_ID_PURGE_SYS_PQ, &pq_mutex);
truncate.current= NULL; truncate.current= NULL;
truncate.last= NULL; truncate.last= NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment