diff --git a/library/std/src/sys/locks/condvar/mod.rs b/library/std/src/sys/locks/condvar/mod.rs index 425b88c1bf0..126a42a2a4c 100644 --- a/library/std/src/sys/locks/condvar/mod.rs +++ b/library/std/src/sys/locks/condvar/mod.rs @@ -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; } } diff --git a/library/std/src/sys/pal/unsupported/locks/condvar.rs b/library/std/src/sys/locks/condvar/no_threads.rs similarity index 100% rename from library/std/src/sys/pal/unsupported/locks/condvar.rs rename to library/std/src/sys/locks/condvar/no_threads.rs diff --git a/library/std/src/sys/locks/mutex/mod.rs b/library/std/src/sys/locks/mutex/mod.rs index cb229d50e55..710cb91fb14 100644 --- a/library/std/src/sys/locks/mutex/mod.rs +++ b/library/std/src/sys/locks/mutex/mod.rs @@ -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; } } diff --git a/library/std/src/sys/pal/unsupported/locks/mutex.rs b/library/std/src/sys/locks/mutex/no_threads.rs similarity index 100% rename from library/std/src/sys/pal/unsupported/locks/mutex.rs rename to library/std/src/sys/locks/mutex/no_threads.rs diff --git a/library/std/src/sys/locks/rwlock/mod.rs b/library/std/src/sys/locks/rwlock/mod.rs index 9d656e57bb3..0564f1fe6fa 100644 --- a/library/std/src/sys/locks/rwlock/mod.rs +++ b/library/std/src/sys/locks/rwlock/mod.rs @@ -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; } } diff --git a/library/std/src/sys/pal/unsupported/locks/rwlock.rs b/library/std/src/sys/locks/rwlock/no_threads.rs similarity index 100% rename from library/std/src/sys/pal/unsupported/locks/rwlock.rs rename to library/std/src/sys/locks/rwlock/no_threads.rs diff --git a/library/std/src/sys/pal/uefi/mod.rs b/library/std/src/sys/pal/uefi/mod.rs index 5a96b8f1c3a..ff8e3bd32ad 100644 --- a/library/std/src/sys/pal/uefi/mod.rs +++ b/library/std/src/sys/pal/uefi/mod.rs @@ -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"] diff --git a/library/std/src/sys/pal/unsupported/locks/mod.rs b/library/std/src/sys/pal/unsupported/locks/mod.rs deleted file mode 100644 index 0e0f9eccb21..00000000000 --- a/library/std/src/sys/pal/unsupported/locks/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -mod condvar; -mod mutex; -mod rwlock; -pub use condvar::Condvar; -pub use mutex::Mutex; -pub use rwlock::RwLock; diff --git a/library/std/src/sys/pal/unsupported/mod.rs b/library/std/src/sys/pal/unsupported/mod.rs index 88f939cbab9..9ce275ee72d 100644 --- a/library/std/src/sys/pal/unsupported/mod.rs +++ b/library/std/src/sys/pal/unsupported/mod.rs @@ -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; diff --git a/library/std/src/sys/pal/wasi/mod.rs b/library/std/src/sys/pal/wasi/mod.rs index 5de2e0e7d63..084b8e0e216 100644 --- a/library/std/src/sys/pal/wasi/mod.rs +++ b/library/std/src/sys/pal/wasi/mod.rs @@ -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"] diff --git a/library/std/src/sys/pal/wasm/mod.rs b/library/std/src/sys/pal/wasm/mod.rs index 910a54b2e01..40b15120e6d 100644 --- a/library/std/src/sys/pal/wasm/mod.rs +++ b/library/std/src/sys/pal/wasm/mod.rs @@ -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"] diff --git a/library/std/src/sys/pal/zkvm/mod.rs b/library/std/src/sys/pal/zkvm/mod.rs index e859269831a..016c977dc33 100644 --- a/library/std/src/sys/pal/zkvm/mod.rs +++ b/library/std/src/sys/pal/zkvm/mod.rs @@ -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;