Skip to content

Commit 11bd530

Browse files
committed
wasi_threads_spawn.wat: sprinkle a few memory fences
While I suspect wait and notify are memory barriers for most implementations, it's safer to issue explicit fences.
1 parent 67c2b3f commit 11bd530

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/testsuite/wasi_threads_spawn.wat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
i32.const 8
1919
local.get $user_arg
2020
i32.store
21+
;; store fence
22+
atomic.fence
2123
;; notify the main
2224
i32.const 0
2325
i32.const 1
@@ -50,6 +52,8 @@
5052
if
5153
unreachable
5254
end
55+
;; load fence
56+
atomic.fence
5357
;; check the tid
5458
local.get $tid
5559
i32.const 4

0 commit comments

Comments
 (0)