Commit 768a7361 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-32899 instrumentation fixup

dict_sys_t::lock(), dict_sys_t::freeze(): Assert that the current thread
is not holding dict_sys.latch in any mode. The SUX lock is reentrant,
but the simpler RW lock that we use in non-debug builds is not.
parent 1ac03fd9
...@@ -1512,6 +1512,7 @@ class dict_sys_t ...@@ -1512,6 +1512,7 @@ class dict_sys_t
void lock(SRW_LOCK_ARGS(const char *file, unsigned line)) void lock(SRW_LOCK_ARGS(const char *file, unsigned line))
{ {
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
ut_ad(!latch.have_any());
if (!latch.x_lock_try()) if (!latch.x_lock_try())
#else #else
if (!latch.wr_lock_try()) if (!latch.wr_lock_try())
...@@ -1540,6 +1541,7 @@ class dict_sys_t ...@@ -1540,6 +1541,7 @@ class dict_sys_t
void freeze() void freeze()
{ {
# ifdef UNIV_DEBUG # ifdef UNIV_DEBUG
ut_ad(!latch.have_any());
latch.s_lock(); latch.s_lock();
# else # else
latch.rd_lock(); latch.rd_lock();
......
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