std: move locks to sys on platforms without threads

This commit is contained in:
joboet 2024-02-15 18:00:24 +01:00
parent f77c4d57fc
commit 21fef03da2
No known key found for this signature in database
GPG Key ID: 704E0149B0194B3C
12 changed files with 10 additions and 17 deletions

View File

@ -29,5 +29,8 @@ cfg_if::cfg_if! {
} else if #[cfg(target_os = "xous")] {
mod xous;
pub use xous::Condvar;
} else {
mod no_threads;
pub use no_threads::Condvar;
}
}

View File

@ -31,5 +31,8 @@ cfg_if::cfg_if! {
} else if #[cfg(target_os = "xous")] {
mod xous;
pub use xous::Mutex;
} else {
mod no_threads;
pub use no_threads::Mutex;
}
}

View File

@ -29,5 +29,8 @@ cfg_if::cfg_if! {
} else if #[cfg(target_os = "xous")] {
mod xous;
pub use xous::RwLock;
} else {
mod no_threads;
pub use no_threads::RwLock;
}
}

View File

@ -19,8 +19,6 @@ pub mod env;
pub mod fs;
#[path = "../unsupported/io.rs"]
pub mod io;
#[path = "../unsupported/locks/mod.rs"]
pub mod locks;
#[path = "../unsupported/net.rs"]
pub mod net;
#[path = "../unsupported/once.rs"]

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

@ -5,7 +5,6 @@ pub mod args;
pub mod env;
pub mod fs;
pub mod io;
pub mod locks;
pub mod net;
pub mod once;
pub mod os;

View File

@ -43,10 +43,7 @@ pub mod thread_local_key;
pub mod time;
cfg_if::cfg_if! {
if #[cfg(target_feature = "atomics")] {
} else {
#[path = "../unsupported/locks/mod.rs"]
pub mod locks;
if #[cfg(not(target_feature = "atomics"))] {
#[path = "../unsupported/once.rs"]
pub mod once;
#[path = "../unsupported/thread_parking.rs"]

View File

@ -48,8 +48,6 @@ cfg_if::cfg_if! {
#[path = "atomics/thread.rs"]
pub mod thread;
} else {
#[path = "../unsupported/locks/mod.rs"]
pub mod locks;
#[path = "../unsupported/once.rs"]
pub mod once;
#[path = "../unsupported/thread.rs"]

View File

@ -33,8 +33,6 @@ pub mod thread_local_key;
#[path = "../unsupported/time.rs"]
pub mod time;
#[path = "../unsupported/locks/mod.rs"]
pub mod locks;
#[path = "../unsupported/thread.rs"]
pub mod thread;