@@ -53,7 +53,7 @@ extern "C" {
5353/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait
5454#[ inline]
5555#[ cfg_attr( test, assert_instr( "i32.atomic.wait" ) ) ]
56- pub unsafe fn wait_i32 (
56+ pub unsafe fn i32_atomic_wait (
5757 ptr : * mut i32 , expression : i32 , timeout_ns : i64 ,
5858) -> i32 {
5959 llvm_atomic_wait_i32 ( ptr, expression, timeout_ns)
@@ -90,25 +90,24 @@ pub unsafe fn wait_i32(
9090/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait
9191#[ inline]
9292#[ cfg_attr( test, assert_instr( "i64.atomic.wait" ) ) ]
93- pub unsafe fn wait_i64 (
93+ pub unsafe fn i64_atomic_wait (
9494 ptr : * mut i64 , expression : i64 , timeout_ns : i64 ,
9595) -> i32 {
9696 llvm_atomic_wait_i64 ( ptr, expression, timeout_ns)
9797}
9898
99- /// Corresponding intrinsic to wasm's [`atomic.wake ` instruction][instr]
99+ /// Corresponding intrinsic to wasm's [`atomic.notify ` instruction][instr]
100100///
101- /// This function will wake up a number of threads blocked on the address
102- /// indicated by `ptr`. Threads previously blocked with the `wait_i32` and
103- /// `wait_i64 ` functions above will be woken up.
101+ /// This function will notify a number of threads blocked on the address
102+ /// indicated by `ptr`. Threads previously blocked with the `i32_atomic_wait`
103+ /// and `i64_atomic_wait ` functions above will be woken up.
104104///
105105/// The `waiters` argument indicates how many waiters should be woken up (a
106- /// maximum). If the value is negative all waiters are woken up, and if the
107- /// value is zero no waiters are woken up.
106+ /// maximum). If the value is zero no waiters are woken up.
108107///
109108/// # Return value
110109///
111- /// Returns the number of waiters which were actually woken up .
110+ /// Returns the number of waiters which were actually notified .
112111///
113112/// # Availability
114113///
@@ -120,6 +119,6 @@ pub unsafe fn wait_i64(
120119/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wake
121120#[ inline]
122121#[ cfg_attr( test, assert_instr( "atomic.wake" ) ) ]
123- pub unsafe fn wake ( ptr : * mut i32 , waiters : i32 ) -> i32 {
124- llvm_atomic_notify ( ptr, waiters)
122+ pub unsafe fn atomic_notify ( ptr : * mut i32 , waiters : u32 ) -> u32 {
123+ llvm_atomic_notify ( ptr, waiters as i32 ) as u32
125124}
0 commit comments