summaryrefslogtreecommitdiff
path: root/storage/innobase/include/sync0rw.ic
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2018-10-14 15:10:31 +0400
committerSergey Vojtovich <svoj@mariadb.org>2018-12-27 22:46:38 +0400
commite60dc209d492e237234dac63293e33558a0daba7 (patch)
tree5e96d85482a1d0ebb2cbbd2782011e8fdb61eb60 /storage/innobase/include/sync0rw.ic
parent9581c4a8f5d6c87a6d34c6d3b826c32bf7f15143 (diff)
downloadmariadb-git-e60dc209d492e237234dac63293e33558a0daba7.tar.gz
MDEV-17441 - InnoDB transition to C++11 atomics
Almost trivial rw_lock_t::waiters transition. Since C++11 doesn't seem to allow mixed (atomic and non-atomic) access to atomic variables, we have to perform atomic initialisation.
Diffstat (limited to 'storage/innobase/include/sync0rw.ic')
-rw-r--r--storage/innobase/include/sync0rw.ic12
1 files changed, 4 insertions, 8 deletions
diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic
index fc24812ab5b..3add168edc8 100644
--- a/storage/innobase/include/sync0rw.ic
+++ b/storage/innobase/include/sync0rw.ic
@@ -414,10 +414,8 @@ rw_lock_x_unlock_func(
We need to signal read/write waiters.
We do not need to signal wait_ex waiters, since they cannot
exist when there is a writer. */
- if (my_atomic_load32_explicit(&lock->waiters,
- MY_MEMORY_ORDER_RELAXED)) {
- my_atomic_store32_explicit(&lock->waiters, 0,
- MY_MEMORY_ORDER_RELAXED);
+ if (lock->waiters.load(std::memory_order_relaxed)) {
+ lock->waiters.store(0, std::memory_order_relaxed);
os_event_set(lock->event);
sync_array_object_signalled();
}
@@ -474,10 +472,8 @@ rw_lock_sx_unlock_func(
waiters. We do not need to signal wait_ex waiters,
since they cannot exist when there is an sx-lock
holder. */
- if (my_atomic_load32_explicit(&lock->waiters,
- MY_MEMORY_ORDER_RELAXED)) {
- my_atomic_store32_explicit(&lock->waiters, 0,
- MY_MEMORY_ORDER_RELAXED);
+ if (lock->waiters.load(std::memory_order_relaxed)) {
+ lock->waiters.store(0, std::memory_order_relaxed);
os_event_set(lock->event);
sync_array_object_signalled();
}