diff options
-rw-r--r-- | storage/innobase/include/rw_lock.h | 9 | ||||
-rw-r--r-- | storage/innobase/sync/srw_lock.cc | 7 |
2 files changed, 5 insertions, 11 deletions
diff --git a/storage/innobase/include/rw_lock.h b/storage/innobase/include/rw_lock.h index ac01c28f346..cae71e8f6c7 100644 --- a/storage/innobase/include/rw_lock.h +++ b/storage/innobase/include/rw_lock.h @@ -132,14 +132,13 @@ public: DBUG_ASSERT(!(l & WRITER)); /* no write lock must have existed */ return (~WRITER_PENDING & l) == 1; } - /** Release an update lock. - @return whether any writers may have to be woken up */ - bool update_unlock() + /** Release an update lock */ + void update_unlock() { - auto l= lock.fetch_and(~UPDATER, std::memory_order_release); + IF_DBUG_ASSERT(auto l=,) + lock.fetch_and(~UPDATER, std::memory_order_release); /* the update lock must have existed */ DBUG_ASSERT((l & (WRITER | UPDATER)) == UPDATER); - return !(~(WRITER_PENDING | UPDATER) & l); } /** Release an exclusive lock */ void write_unlock() diff --git a/storage/innobase/sync/srw_lock.cc b/storage/innobase/sync/srw_lock.cc index 17260ebb318..45bf7a29c00 100644 --- a/storage/innobase/sync/srw_lock.cc +++ b/storage/innobase/sync/srw_lock.cc @@ -233,13 +233,8 @@ void ssux_lock_low::rd_unlock() { if (read_unlock()) writer_wake(); } void ssux_lock_low::u_unlock() { -#ifdef SRW_LOCK_DUMMY update_unlock(); - writer_wake(); /* Wake up either write_lock() or update_lock() */ -#else - if (update_unlock()) - writer_wake(); /* Wake up one waiter (hopefully the writer) */ -#endif + readers_wake(); /* Wake up all write_lock(), update_lock() */ } void ssux_lock_low::wr_unlock() { write_unlock(); readers_wake(); } |