Skip to content

Commit 30c9f35

Browse files
committed
Stabilize WebAssembly atomic intrinsics
This commit stabilizes the wasm atomic intrinsics now that the threads proposal has advanced to Stage 4, and is shipping in browsers. Unfortunately these intrinsics still aren't available through the precompiled versions of the standard library because atomics are no
1 parent a5db4ea commit 30c9f35

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/core_arch/src/wasm32/atomic.rs

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extern "C" {
5151
/// [instr]: https://webassembly.github.io/threads/syntax/instructions.html#syntax-instr-atomic-memory
5252
#[inline]
5353
#[cfg_attr(test, assert_instr("i32.atomic.wait"))]
54+
#[stable(feature = "wasm_atomics", since = "1.50.0")]
5455
pub unsafe fn memory_atomic_wait32(ptr: *mut i32, expression: i32, timeout_ns: i64) -> i32 {
5556
llvm_atomic_wait_i32(ptr, expression, timeout_ns)
5657
}
@@ -86,6 +87,7 @@ pub unsafe fn memory_atomic_wait32(ptr: *mut i32, expression: i32, timeout_ns: i
8687
/// [instr]: https://webassembly.github.io/threads/syntax/instructions.html#syntax-instr-atomic-memory
8788
#[inline]
8889
#[cfg_attr(test, assert_instr("i64.atomic.wait"))]
90+
#[stable(feature = "wasm_atomics", since = "1.50.0")]
8991
pub unsafe fn memory_atomic_wait64(ptr: *mut i64, expression: i64, timeout_ns: i64) -> i32 {
9092
llvm_atomic_wait_i64(ptr, expression, timeout_ns)
9193
}
@@ -113,6 +115,7 @@ pub unsafe fn memory_atomic_wait64(ptr: *mut i64, expression: i64, timeout_ns: i
113115
/// [instr]: https://webassembly.github.io/threads/syntax/instructions.html#syntax-instr-atomic-memory
114116
#[inline]
115117
#[cfg_attr(test, assert_instr("atomic.wake"))]
118+
#[stable(feature = "wasm_atomics", since = "1.50.0")]
116119
pub unsafe fn memory_atomic_notify(ptr: *mut i32, waiters: u32) -> u32 {
117120
llvm_atomic_notify(ptr, waiters as i32) as u32
118121
}

0 commit comments

Comments
 (0)