Fix naming for redbean shared memory atomics

This commit is contained in:
Justine Tunney 2022-10-06 09:41:22 -07:00
parent a5b483f2d4
commit 60b68d7152
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
4 changed files with 18 additions and 12 deletions

View file

@ -54,7 +54,7 @@ function Lock()
end
end
function Unlock()
local old = mem:add(LOCK, -1)
local old = mem:fetch_add(LOCK, -1)
if old == 2 then
mem:store(LOCK, 0)
mem:wake(LOCK, 1)