Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bindings and comments for Atomics.wait #3509

Merged
merged 2 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

### Changed

* Fixed bindings and comments for `Atomics.wait`.
[#3509](https://github.com/rustwasm/wasm-bindgen/pull/3509)
allsey87 marked this conversation as resolved.
Show resolved Hide resolved

* Updated the WebGPU WebIDL.
The optional `message` argument of [`GPUPipelineError`](https://www.w3.org/TR/webgpu/#gpupipelineerror)'s constructor has been manually specified as a required argument,
because required arguments occurring after optional arguments are currently not supported by the generator.
Expand Down
16 changes: 8 additions & 8 deletions crates/js-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,32 +1148,32 @@ pub mod Atomics {
/// Note: This operation only works with a shared `Int32Array`
/// and may not be allowed on the main thread.
///
/// You should use `wait_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`.
/// You should use `wait_bigint` to operate on a `BigInt64Array`.
///
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait)
#[wasm_bindgen(js_namespace = Atomics, catch)]
pub fn wait(typed_array: &Int32Array, index: u32, value: i32) -> Result<JsString, JsValue>;

/// The static `Atomics.wait()` method verifies that a given
/// position in an `Int32Array` still contains a given value
/// position in an `BigInt64Array` still contains a given value
/// and if so sleeps, awaiting a wakeup or a timeout.
/// It returns a string which is either "ok", "not-equal", or "timed-out".
/// Note: This operation only works with a shared `Int32Array`
/// Note: This operation only works with a shared `BigInt64Array`
/// and may not be allowed on the main thread.
///
/// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`.
/// You should use `wait` to operate on a `Int32Array`.
///
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait)
#[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)]
pub fn wait_bigint(
typed_array: &Int32Array,
typed_array: &BigInt64Array,
index: u32,
value: i64,
) -> Result<JsString, JsValue>;

/// Like `wait()`, but with timeout
///
/// You should use `wait_with_timeout_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`.
/// You should use `wait_with_timeout_bigint` to operate on a `BigInt64Array`.
///
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait)
#[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)]
Expand All @@ -1186,12 +1186,12 @@ pub mod Atomics {

/// Like `wait()`, but with timeout
///
/// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`.
/// You should use `wait_with_timeout` to operate on a `Int32Array`.
///
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait)
#[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)]
pub fn wait_with_timeout_bigint(
typed_array: &Int32Array,
typed_array: &BigInt64Array,
index: u32,
value: i64,
timeout: f64,
Expand Down