1
Fork 0

Add WaitOnAddress/WakeByAddress API to sys::windows::c.

This commit is contained in:
Mara Bos 2020-10-06 00:34:15 +02:00
parent 738d4a7a36
commit 92f7ba8446
2 changed files with 16 additions and 0 deletions

View file

@ -1096,3 +1096,18 @@ compat_fn! {
panic!("rwlocks not available")
}
}
compat_fn! {
"api-ms-win-core-synch-l1-2-0":
pub fn WaitOnAddress(
Address: LPVOID,
CompareAddress: LPVOID,
AddressSize: SIZE_T,
dwMilliseconds: DWORD
) -> BOOL {
panic!("WaitOnAddress not available")
}
pub fn WakeByAddressSingle(Address: LPVOID) -> () {
// If this api is unavailable, there cannot be anything waiting, because
// WaitOnAddress would've panicked. So it's fine to do nothing here.
}
}

View file

@ -34,6 +34,7 @@ macro_rules! compat_fn {
)*) => ($(
$(#[$meta])*
pub mod $symbol {
#[allow(unused_imports)]
use super::*;
use crate::sync::atomic::{AtomicUsize, Ordering};
use crate::mem;