Skip to content

Commit 21fef03

Browse files
committed
std: move locks to sys on platforms without threads
1 parent f77c4d5 commit 21fef03

File tree

12 files changed

+10
-17
lines changed

12 files changed

+10
-17
lines changed

Diff for: library/std/src/sys/locks/condvar/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ cfg_if::cfg_if! {
2929
} else if #[cfg(target_os = "xous")] {
3030
mod xous;
3131
pub use xous::Condvar;
32+
} else {
33+
mod no_threads;
34+
pub use no_threads::Condvar;
3235
}
3336
}

Diff for: library/std/src/sys/locks/mutex/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@ cfg_if::cfg_if! {
3131
} else if #[cfg(target_os = "xous")] {
3232
mod xous;
3333
pub use xous::Mutex;
34+
} else {
35+
mod no_threads;
36+
pub use no_threads::Mutex;
3437
}
3538
}

Diff for: library/std/src/sys/locks/rwlock/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ cfg_if::cfg_if! {
2929
} else if #[cfg(target_os = "xous")] {
3030
mod xous;
3131
pub use xous::RwLock;
32+
} else {
33+
mod no_threads;
34+
pub use no_threads::RwLock;
3235
}
3336
}

Diff for: library/std/src/sys/pal/uefi/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ pub mod env;
1919
pub mod fs;
2020
#[path = "../unsupported/io.rs"]
2121
pub mod io;
22-
#[path = "../unsupported/locks/mod.rs"]
23-
pub mod locks;
2422
#[path = "../unsupported/net.rs"]
2523
pub mod net;
2624
#[path = "../unsupported/once.rs"]

Diff for: library/std/src/sys/pal/unsupported/locks/mod.rs

-6
This file was deleted.

Diff for: library/std/src/sys/pal/unsupported/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pub mod args;
55
pub mod env;
66
pub mod fs;
77
pub mod io;
8-
pub mod locks;
98
pub mod net;
109
pub mod once;
1110
pub mod os;

Diff for: library/std/src/sys/pal/wasi/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ pub mod thread_local_key;
4343
pub mod time;
4444

4545
cfg_if::cfg_if! {
46-
if #[cfg(target_feature = "atomics")] {
47-
} else {
48-
#[path = "../unsupported/locks/mod.rs"]
49-
pub mod locks;
46+
if #[cfg(not(target_feature = "atomics"))] {
5047
#[path = "../unsupported/once.rs"]
5148
pub mod once;
5249
#[path = "../unsupported/thread_parking.rs"]

Diff for: library/std/src/sys/pal/wasm/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ cfg_if::cfg_if! {
4848
#[path = "atomics/thread.rs"]
4949
pub mod thread;
5050
} else {
51-
#[path = "../unsupported/locks/mod.rs"]
52-
pub mod locks;
5351
#[path = "../unsupported/once.rs"]
5452
pub mod once;
5553
#[path = "../unsupported/thread.rs"]

Diff for: library/std/src/sys/pal/zkvm/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ pub mod thread_local_key;
3333
#[path = "../unsupported/time.rs"]
3434
pub mod time;
3535

36-
#[path = "../unsupported/locks/mod.rs"]
37-
pub mod locks;
3836
#[path = "../unsupported/thread.rs"]
3937
pub mod thread;
4038

0 commit comments

Comments
 (0)