Use relaxed ordering for nbio's mpsc head counter and pool's destroy exchange, as their acquire paired with nothing

This commit is contained in:
gingerBill committed 2026-10-07 22:44:36 +01:00
1 parent b12195bebf
commit 7571a2676f
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ init :: proc(p: ^Pool($T), $link_field: string, block_size: uint = DEFAULT_BLOCK
}
destroy :: proc(p: ^Pool($T)) {
elem := sync.atomic_exchange_explicit(&p.free_list, nil, .Acquire)
elem := sync.atomic_exchange_explicit(&p.free_list, nil, .Relaxed)
sync.atomic_store_explicit(&p.num_ready, 0, .Relaxed)
+1 -1
View File
@@ -32,7 +32,7 @@ mpsc_enqueue :: proc(mpscq: ^Multi_Producer_Single_Consumer, obj: rawptr) -> boo
return false
}
head := sync.atomic_add_explicit(&mpscq.head, 1, .Acquire)
head := sync.atomic_add_explicit(&mpscq.head, 1, .Relaxed)
assert(mpscq.buffer[head & mpscq.mask] == nil)
rv := sync.atomic_exchange_explicit(&mpscq.buffer[head & mpscq.mask], obj, .Release)
assert(rv == nil)