Skip to content

Commit 92f7ba8

Browse files
committed
Add WaitOnAddress/WakeByAddress API to sys::windows::c.
1 parent 738d4a7 commit 92f7ba8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

library/std/src/sys/windows/c.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,3 +1096,18 @@ compat_fn! {
10961096
panic!("rwlocks not available")
10971097
}
10981098
}
1099+
compat_fn! {
1100+
"api-ms-win-core-synch-l1-2-0":
1101+
pub fn WaitOnAddress(
1102+
Address: LPVOID,
1103+
CompareAddress: LPVOID,
1104+
AddressSize: SIZE_T,
1105+
dwMilliseconds: DWORD
1106+
) -> BOOL {
1107+
panic!("WaitOnAddress not available")
1108+
}
1109+
pub fn WakeByAddressSingle(Address: LPVOID) -> () {
1110+
// If this api is unavailable, there cannot be anything waiting, because
1111+
// WaitOnAddress would've panicked. So it's fine to do nothing here.
1112+
}
1113+
}

library/std/src/sys/windows/compat.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ macro_rules! compat_fn {
3434
)*) => ($(
3535
$(#[$meta])*
3636
pub mod $symbol {
37+
#[allow(unused_imports)]
3738
use super::*;
3839
use crate::sync::atomic::{AtomicUsize, Ordering};
3940
use crate::mem;

0 commit comments

Comments
 (0)