summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-29 12:00:31 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-29 12:11:37 +0300
commit2fbf7514078c4d0171d96a309174d8dedcc9e0e5 (patch)
tree353c048c713efdcd99b153e4dc5242a3f86e058e
parent57f7b4866f1347ebf3ee67fe61de3871e56e23cc (diff)
downloadmariadb-git-2fbf7514078c4d0171d96a309174d8dedcc9e0e5.tar.gz
MDEV-22456 after-merge fix: Avoid functional change to rw_lock_s_unlock()
In the merge 9e6e43551fc61bc34152f8d60f5d72f0d3814787 we replaced direct use of std::atomic with a wrapper class, so that dict_index_t::lock will support the default assignment operator. As part of that change, one occurrence of std::memory_order_release was accidentally replaced with std::memory_order_relaxed. Thanks to Sergey Vojtovich for noticing this.
-rw-r--r--storage/innobase/include/sync0rw.ic3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic
index 70723b05944..603e902d01c 100644
--- a/storage/innobase/include/sync0rw.ic
+++ b/storage/innobase/include/sync0rw.ic
@@ -355,7 +355,8 @@ rw_lock_s_unlock_func(
ut_d(rw_lock_remove_debug_info(lock, pass, RW_LOCK_S));
/* Increment lock_word to indicate 1 less reader */
- int32_t lock_word = lock->lock_word.fetch_add(1);
+ int32_t lock_word = lock->lock_word.fetch_add(
+ 1, std::memory_order_release);
if (lock_word == -1 || lock_word == -X_LOCK_HALF_DECR - 1) {
/* wait_ex waiter exists. It may not be asleep, but we signal