MDEV-22456 after-merge fix: Avoid functional change to rw_lock_s_unlock()

In the merge 9e6e43551f 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.
This commit is contained in:
Marko Mäkelä 2020-05-29 12:00:31 +03:00
parent 57f7b4866f
commit 2fbf751407

View file

@ -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