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.
This commit is contained in:
Marko Mäkelä 2024-02-21 13:03:25 +02:00
parent 903ae30069
commit 042c3fc432

View file

@ -646,7 +646,9 @@ bool srw_lock_debug::have_rd() const noexcept
readers_lock.wr_lock();
bool found= r->find(pthread_self()) != r->end();
readers_lock.wr_unlock();
# ifndef SUX_LOCK_GENERIC
ut_ad(!found || is_locked());
# endif
return found;
}
return false;
@ -656,7 +658,9 @@ bool srw_lock_debug::have_wr() const noexcept
{
if (writer != pthread_self())
return false;
# ifndef SUX_LOCK_GENERIC
ut_ad(is_write_locked());
# endif
return true;
}