summaryrefslogtreecommitdiffstats
path: root/mysys/lf_alloc-pin.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
commit347c164c35eddab388009470e6848cb361ac93f8 (patch)
tree2c0c44eac690f510bb0a35b2a13b36d606b77b6b /mysys/lf_alloc-pin.c
parentReleasing progress-linux version 1:10.11.7-4~progress7.99u1. (diff)
downloadmariadb-347c164c35eddab388009470e6848cb361ac93f8.tar.xz
mariadb-347c164c35eddab388009470e6848cb361ac93f8.zip
Merging upstream version 1:10.11.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--mysys/lf_alloc-pin.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index fc3f320a..4dc41645 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -291,7 +291,7 @@ static int harvest_pins(LF_PINS *el, struct st_harvester *hv)
{
for (i= 0; i < LF_PINBOX_PINS; i++)
{
- void *p= el->pin[i];
+ void *p= my_atomic_loadptr((void **)&el->pin[i]);
if (p)
*hv->granary++= p;
}
@@ -316,7 +316,7 @@ static int match_pins(LF_PINS *el, void *addr)
LF_PINS *el_end= el+LF_DYNARRAY_LEVEL_LENGTH;
for (; el < el_end; el++)
for (i= 0; i < LF_PINBOX_PINS; i++)
- if (el->pin[i] == addr)
+ if (my_atomic_loadptr((void **)&el->pin[i]) == addr)
return 1;
return 0;
}
@@ -501,7 +501,8 @@ void *lf_alloc_new(LF_PINS *pins)
{
node= allocator->top;
lf_pin(pins, 0, node);
- } while (node != allocator->top && LF_BACKOFF());
+ } while (node != my_atomic_loadptr((void **)(char *)&allocator->top)
+ && LF_BACKOFF());
if (!node)
{
node= (void *)my_malloc(key_memory_lf_node, allocator->element_size,