From a528d25803e1d6892ecb837f49b84ad3fe0909cd Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 28 Jul 2021 21:25:24 +1000 Subject: [PATCH] Experiment with some atomic loads. --- miniaudio.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index 2f0e0bad..33be75e7 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -57457,7 +57457,7 @@ MA_API ma_result ma_resource_manager_job_queue_post(ma_resource_manager_job_queu /* The job is stored in memory so now we need to add it to our linked list. We only ever add items to the end of the list. */ for (;;) { - tail = pQueue->tail; + tail = c89atomic_load_64(&pQueue->tail); next = pQueue->pJobs[ma_resource_manager_job_extract_slot(tail)].next; if (ma_resource_manager_job_toc_to_allocation(tail) == ma_resource_manager_job_toc_to_allocation(pQueue->tail)) { @@ -57514,8 +57514,8 @@ MA_API ma_result ma_resource_manager_job_queue_next(ma_resource_manager_job_queu /* Now we need to remove the root item from the list. This must be done without locking. */ for (;;) { - head = pQueue->head; - tail = pQueue->tail; + head = c89atomic_load_64(&pQueue->head); + tail = c89atomic_load_64(&pQueue->tail); next = pQueue->pJobs[ma_resource_manager_job_extract_slot(head)].next; if (ma_resource_manager_job_toc_to_allocation(head) == ma_resource_manager_job_toc_to_allocation(pQueue->head)) {