diff options
Diffstat (limited to 'storage/innobase/include/sux_lock.h')
-rw-r--r-- | storage/innobase/include/sux_lock.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/storage/innobase/include/sux_lock.h b/storage/innobase/include/sux_lock.h index e592e3825ad..17a484c732e 100644 --- a/storage/innobase/include/sux_lock.h +++ b/storage/innobase/include/sux_lock.h @@ -68,10 +68,13 @@ public: ut_ad(!writer.load(std::memory_order_relaxed)); ut_ad(!recursive); ut_d(readers_lock.init()); - ut_ad(!readers.load(std::memory_order_relaxed)); +#ifdef UNIV_DEBUG + if (auto r= readers.load(std::memory_order_relaxed)) + ut_ad(r->empty()); +#endif } - /** Free the rw-lock after create() */ + /** Free the rw-lock after init() */ void free() { ut_ad(!writer.load(std::memory_order_relaxed)); @@ -274,6 +277,8 @@ public: bool is_write_locked() const { return lock.is_write_locked(); } + bool is_locked_or_waiting() const { return lock.is_locked_or_waiting(); } + inline void lock_shared(); inline void unlock_shared(); }; @@ -291,7 +296,10 @@ template<> inline void sux_lock<ssux_lock_impl<true>>::init() ut_ad(!writer.load(std::memory_order_relaxed)); ut_ad(!recursive); ut_d(readers_lock.init()); - ut_ad(!readers.load(std::memory_order_relaxed)); +#ifdef UNIV_DEBUG + if (auto r= readers.load(std::memory_order_relaxed)) + ut_ad(r->empty()); +#endif } template<> |