Commit 042c3fc4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24167 fixup: srw_lock_debug for SUX_LOCK_GENERIC

srw_lock_debug::have_rd(), srw_lock_debug::have_wr():
For SUX_LOCK_GENERIC (no futex based synchronization primitives),
we cannot check if the underlying srw_lock is held by us.

Thanks to Dmitry Shulga for pointing out this build failure.
parent 903ae300
...@@ -646,7 +646,9 @@ bool srw_lock_debug::have_rd() const noexcept ...@@ -646,7 +646,9 @@ bool srw_lock_debug::have_rd() const noexcept
readers_lock.wr_lock(); readers_lock.wr_lock();
bool found= r->find(pthread_self()) != r->end(); bool found= r->find(pthread_self()) != r->end();
readers_lock.wr_unlock(); readers_lock.wr_unlock();
# ifndef SUX_LOCK_GENERIC
ut_ad(!found || is_locked()); ut_ad(!found || is_locked());
# endif
return found; return found;
} }
return false; return false;
...@@ -656,7 +658,9 @@ bool srw_lock_debug::have_wr() const noexcept ...@@ -656,7 +658,9 @@ bool srw_lock_debug::have_wr() const noexcept
{ {
if (writer != pthread_self()) if (writer != pthread_self())
return false; return false;
# ifndef SUX_LOCK_GENERIC
ut_ad(is_write_locked()); ut_ad(is_write_locked());
# endif
return true; return true;
} }
......
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