瀏覽代碼

Fix atomic memory order for `sync.ticket_mutex_unlock`

Feoramund 1 年之前
父節點
當前提交
dbb783fbf2
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/sync/extended.odin

+ 1 - 1
core/sync/extended.odin

@@ -297,7 +297,7 @@ waiting to acquire the lock, exactly one of those threads is unblocked and
 allowed into the critical section.
 */
 ticket_mutex_unlock :: #force_inline proc "contextless" (m: ^Ticket_Mutex) {
-	atomic_add_explicit(&m.serving, 1, .Relaxed)
+	atomic_add_explicit(&m.serving, 1, .Release)
 }
 
 /*