mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
Experiment with some atomic loads.
This commit is contained in:
+3
-3
@@ -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. */
|
/* 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 (;;) {
|
for (;;) {
|
||||||
tail = pQueue->tail;
|
tail = c89atomic_load_64(&pQueue->tail);
|
||||||
next = pQueue->pJobs[ma_resource_manager_job_extract_slot(tail)].next;
|
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)) {
|
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. */
|
/* Now we need to remove the root item from the list. This must be done without locking. */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
head = pQueue->head;
|
head = c89atomic_load_64(&pQueue->head);
|
||||||
tail = pQueue->tail;
|
tail = c89atomic_load_64(&pQueue->tail);
|
||||||
next = pQueue->pJobs[ma_resource_manager_job_extract_slot(head)].next;
|
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)) {
|
if (ma_resource_manager_job_toc_to_allocation(head) == ma_resource_manager_job_toc_to_allocation(pQueue->head)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user