@@ -53,7 +53,7 @@ extern "C" {
53
53
/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait
54
54
#[ inline]
55
55
#[ cfg_attr( test, assert_instr( "i32.atomic.wait" ) ) ]
56
- pub unsafe fn wait_i32 (
56
+ pub unsafe fn i32_atomic_wait (
57
57
ptr : * mut i32 , expression : i32 , timeout_ns : i64 ,
58
58
) -> i32 {
59
59
llvm_atomic_wait_i32 ( ptr, expression, timeout_ns)
@@ -90,25 +90,24 @@ pub unsafe fn wait_i32(
90
90
/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait
91
91
#[ inline]
92
92
#[ cfg_attr( test, assert_instr( "i64.atomic.wait" ) ) ]
93
- pub unsafe fn wait_i64 (
93
+ pub unsafe fn i64_atomic_wait (
94
94
ptr : * mut i64 , expression : i64 , timeout_ns : i64 ,
95
95
) -> i32 {
96
96
llvm_atomic_wait_i64 ( ptr, expression, timeout_ns)
97
97
}
98
98
99
- /// Corresponding intrinsic to wasm's [`atomic.wake ` instruction][instr]
99
+ /// Corresponding intrinsic to wasm's [`atomic.notify ` instruction][instr]
100
100
///
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.
104
104
///
105
105
/// 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.
108
107
///
109
108
/// # Return value
110
109
///
111
- /// Returns the number of waiters which were actually woken up .
110
+ /// Returns the number of waiters which were actually notified .
112
111
///
113
112
/// # Availability
114
113
///
@@ -120,6 +119,6 @@ pub unsafe fn wait_i64(
120
119
/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wake
121
120
#[ inline]
122
121
#[ 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
125
124
}
0 commit comments