diff options
-rw-r--r-- | mysys/lf_alloc-pin.c | 5 | ||||
-rw-r--r-- | mysys/lf_hash.c | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index 0dc524be336..880ef44e9ca 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -256,8 +256,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 a7553b349de..ca3a377190f 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)) { |