std: move locks to sys on Windows

This commit is contained in:
joboet 2024-02-15 17:47:42 +01:00
parent 491d1a7664
commit 6ee45102fe
No known key found for this signature in database
GPG Key ID: 704E0149B0194B3C
8 changed files with 10 additions and 8 deletions

View File

@ -14,6 +14,9 @@ cfg_if::cfg_if! {
} else if #[cfg(target_family = "unix")] {
mod pthread;
pub use pthread::Condvar;
} else if #[cfg(target_os = "windows")] {
mod windows;
pub use windows::Condvar;
} else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] {
mod sgx;
pub use sgx::Condvar;

View File

@ -27,7 +27,7 @@ impl Condvar {
let r = c::SleepConditionVariableSRW(
self.inner.get(),
mutex::raw(mutex),
crate::sys::pal::windows::dur2timeout(dur),
crate::sys::pal::dur2timeout(dur),
0,
);
if r == 0 {

View File

@ -19,6 +19,9 @@ cfg_if::cfg_if! {
))] {
mod pthread;
pub use pthread::{Mutex, raw};
} else if #[cfg(target_os = "windows")] {
mod windows;
pub use windows::{Mutex, raw};
} else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] {
mod sgx;
pub use sgx::Mutex;

View File

@ -14,6 +14,9 @@ cfg_if::cfg_if! {
} else if #[cfg(target_family = "unix")] {
mod queue;
pub use queue::RwLock;
} else if #[cfg(target_os = "windows")] {
mod windows;
pub use windows::RwLock;
} else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] {
mod sgx;
pub use sgx::RwLock;

View File

@ -1,6 +0,0 @@
mod condvar;
mod mutex;
mod rwlock;
pub use condvar::Condvar;
pub use mutex::Mutex;
pub use rwlock::RwLock;

View File

@ -19,7 +19,6 @@ pub mod env;
pub mod fs;
pub mod handle;
pub mod io;
pub mod locks;
pub mod memchr;
pub mod net;
pub mod os;