mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 08:44:04 +02:00
Fix a bug with the lock-free job queue.
This commit is contained in:
+2
-2
@@ -37908,7 +37908,7 @@ MA_API ma_result ma_slot_allocator_alloc(ma_slot_allocator* pAllocator, ma_uint6
|
|||||||
pAllocator->pSlots[slotIndex] += 1;
|
pAllocator->pSlots[slotIndex] += 1;
|
||||||
|
|
||||||
/* Construct the output value. */
|
/* Construct the output value. */
|
||||||
*pSlot = ((ma_uint64)pAllocator->pSlots[slotIndex] << 32 | slotIndex);
|
*pSlot = (((ma_uint64)pAllocator->pSlots[slotIndex] << 32) | slotIndex);
|
||||||
|
|
||||||
return MA_SUCCESS;
|
return MA_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -57519,7 +57519,7 @@ MA_API ma_result ma_resource_manager_job_queue_next(ma_resource_manager_job_queu
|
|||||||
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)) {
|
||||||
if (ma_resource_manager_job_toc_to_allocation(head) == ma_resource_manager_job_toc_to_allocation(tail)) {
|
if (ma_resource_manager_job_extract_slot(head) == ma_resource_manager_job_extract_slot(tail)) {
|
||||||
if (ma_resource_manager_job_extract_slot(next) == 0xFFFF) {
|
if (ma_resource_manager_job_extract_slot(next) == 0xFFFF) {
|
||||||
return MA_NO_DATA_AVAILABLE;
|
return MA_NO_DATA_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user