Skip to content

Commit

Permalink
[Overview] Divide timeout by 1000000, for ms vs. ns (WebAssembly#109)
Browse files Browse the repository at this point in the history
JavaScript `Atomics.wait` takes milliseconds, but wasm uses nanoseconds
for timeout.
  • Loading branch information
binji authored Nov 15, 2018
1 parent 6e0822f commit 7dda80c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proposals/threads/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ For the web embedding, `i32.atomic.wait` is equivalent in behavior to executing
1. Let `memory` be a `WebAssembly.Memory` object for this module.
1. Let `buffer` be `memory`([`Get`][](`memory`, `"buffer"`)).
1. Let `int32array` be [`Int32Array`][](`buffer`).
1. Let `result` be [`Atomics.wait`][](`int32array`, `address`, `expected`, `timeout`),
1. Let `result` be [`Atomics.wait`][](`int32array`, `address`, `expected`, `timeout` / 1000000),
where `address`, `expected`, and `timeout` are the operands to the `wait` operator
as described above.
1. Return an `i32` value as described in the above table:
Expand All @@ -404,7 +404,7 @@ no `Int64Array` type, and an ECMAScript `Number` cannot represent all values of
1. Let `int64array` be `Int64Array`[](`buffer`), where `Int64Array` is a
typed-array constructor that allows 64-bit integer views with an element size
of `8`.
1. Let `result` be [`Atomics.wait`][](`int64array`, `address`, `expected`, `timeout`),
1. Let `result` be [`Atomics.wait`][](`int64array`, `address`, `expected`, `timeout` / 1000000),
where `address`, `expected`, and `timeout` are the operands to the `wait` operator
as described above. The [`Atomics.wait`][] operation is modified:
1. `ValidateSharedIntegerTypedArray` will fail if the typed-array type is not an
Expand Down

0 comments on commit 7dda80c

Please sign in to comment.