Skip to content

Commit

Permalink
wasi_threads_spawn.wat: sprinkle a few memory fences
Browse files Browse the repository at this point in the history
While I suspect wait and notify are memory barriers for most
implementations, it's safer to issue explicit fences.
  • Loading branch information
yamt committed Jan 23, 2023
1 parent d3610f2 commit c6be70c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/testsuite/wasi_threads_spawn.wat
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
i32.const 8
local.get $user_arg
i32.store
;; store fence
atomic.fence
;; notify the main
i32.const 0
i32.const 1
Expand Down Expand Up @@ -50,6 +52,8 @@
if
unreachable
end
;; load fence
atomic.fence
;; check the tid
local.get $tid
i32.const 4
Expand Down

0 comments on commit c6be70c

Please sign in to comment.