inc and dec are atomic in JS backend (#16129)

This commit is contained in:
flywind 2020-11-25 21:09:03 +08:00 • committed by GitHub
commit 7848da7abe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,9 @@
discard """
target: "c cpp js"
"""
var x = 10
atomicInc(x)
doAssert x == 11
atomicDec(x)
doAssert x == 10