summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-12-06 21:38:43 +0100
committerSergei Golubchik <serg@mariadb.org>2021-12-06 22:23:07 +0100
commit153b75b5762eacff1ab257e6e22522efd53e7c3e (patch)
treef61a0b96a53c43cd5db830ec2d95ec7e09ef7806 /mysys
parent045f5f7b10d391fc1653583594b4efbb5a495c4d (diff)
parent71027eceac31c9f35c94c9893abb072e41867541 (diff)
downloadmariadb-git-153b75b5762eacff1ab257e6e22522efd53e7c3e.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysys')
-rw-r--r--mysys/lf_alloc-pin.c5
-rw-r--r--mysys/lf_hash.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index b98684556c3..280cf74e657 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -250,8 +250,9 @@ static int ptr_cmp(void **a, void **b)
#define add_to_purgatory(PINS, ADDR) \
do \
{ \
- *(void **)((char *)(ADDR)+(PINS)->pinbox->free_ptr_offset)= \
- (PINS)->purgatory; \
+ my_atomic_storeptr_explicit( \
+ (void **)((char *)(ADDR)+(PINS)->pinbox->free_ptr_offset), \
+ (PINS)->purgatory, MY_MEMORY_ORDER_RELEASE); \
(PINS)->purgatory= (ADDR); \
(PINS)->purgatory_count++; \
} while (0)
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index 911d7228c0e..8bff2e3bfa4 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -111,13 +111,16 @@ retry:
cur_hashnr= cursor->curr->hashnr;
cur_keylen= cursor->curr->keylen;
- cur_key= cursor->curr->key;
+ cur_key= my_atomic_loadptr_explicit((void **) &cursor->curr->key,
+ MY_MEMORY_ORDER_ACQUIRE);
do {
- link= cursor->curr->link;
+ link= (intptr) my_atomic_loadptr_explicit((void **) &cursor->curr->link,
+ MY_MEMORY_ORDER_RELAXED);
cursor->next= PTR(link);
lf_pin(pins, 0, cursor->next);
- } while (link != cursor->curr->link && LF_BACKOFF());
+ } while (link != (intptr) my_atomic_loadptr((void **) &cursor->curr->link)
+ && LF_BACKOFF());
if (!DELETED(link))
{