Skip to content

Commit a56fd37

Browse files
committed
std: move thread parking to sys::sync
1 parent fcc06c8 commit a56fd37

File tree

23 files changed

+25
-57
lines changed

23 files changed

+25
-57
lines changed

library/std/src/sys/pal/sgx/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ mod task_queue {
6767
pub mod wait_notify {
6868
use crate::pin::Pin;
6969
use crate::sync::Arc;
70-
use crate::sys_common::thread_parking::Parker;
70+
use crate::sys::sync::Parker;
7171

7272
pub struct Notifier(Arc<Parker>);
7373

library/std/src/sys/pal/teeos/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ pub mod thread;
3030
pub mod thread_local_dtor;
3131
#[path = "../unix/thread_local_key.rs"]
3232
pub mod thread_local_key;
33-
#[path = "../unsupported/thread_parking.rs"]
34-
pub mod thread_parking;
3533
#[allow(non_upper_case_globals)]
3634
#[path = "../unix/time.rs"]
3735
pub mod time;

library/std/src/sys/pal/uefi/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ pub mod stdio;
3030
pub mod thread;
3131
#[path = "../unsupported/thread_local_key.rs"]
3232
pub mod thread_local_key;
33-
#[path = "../unsupported/thread_parking.rs"]
34-
pub mod thread_parking;
3533
pub mod time;
3634

3735
mod helpers;

library/std/src/sys/pal/unix/thread_parking/netbsd.rs renamed to library/std/src/sys/pal/unix/thread_parking.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Only used on NetBSD. If other platforms start using id-based parking, use
2+
// separate modules for each platform.
3+
#![cfg(target_os = "netbsd")]
4+
15
use crate::ffi::{c_int, c_void};
26
use crate::ptr;
37
use crate::time::Duration;

library/std/src/sys/pal/unix/thread_parking/mod.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

library/std/src/sys/pal/unsupported/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub mod thread;
1414
#[cfg(target_thread_local)]
1515
pub mod thread_local_dtor;
1616
pub mod thread_local_key;
17-
pub mod thread_parking;
1817
pub mod time;
1918

2019
mod common;

library/std/src/sys/pal/wasi/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ pub mod thread_local_dtor;
3939
pub mod thread_local_key;
4040
pub mod time;
4141

42-
cfg_if::cfg_if! {
43-
if #[cfg(not(target_feature = "atomics"))] {
44-
#[path = "../unsupported/thread_parking.rs"]
45-
pub mod thread_parking;
46-
}
47-
}
48-
4942
#[path = "../unsupported/common.rs"]
5043
#[deny(unsafe_op_in_unsafe_fn)]
5144
#[allow(unused)]

library/std/src/sys/pal/wasip2/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ pub mod thread_local_key;
4141
#[path = "../wasi/time.rs"]
4242
pub mod time;
4343

44-
cfg_if::cfg_if! {
45-
if #[cfg(target_feature = "atomics")] {
46-
compile_error!("The wasm32-wasip2 target does not support atomics");
47-
} else {
48-
#[path = "../unsupported/thread_parking.rs"]
49-
pub mod thread_parking;
50-
}
51-
}
52-
5344
#[path = "../unsupported/common.rs"]
5445
#[deny(unsafe_op_in_unsafe_fn)]
5546
#[allow(unused)]

library/std/src/sys/pal/wasm/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ cfg_if::cfg_if! {
5050
} else {
5151
#[path = "../unsupported/thread.rs"]
5252
pub mod thread;
53-
#[path = "../unsupported/thread_parking.rs"]
54-
pub mod thread_parking;
5553
}
5654
}
5755

library/std/src/sys/pal/windows/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ pub mod stdio;
3333
pub mod thread;
3434
pub mod thread_local_dtor;
3535
pub mod thread_local_key;
36-
pub mod thread_parking;
3736
pub mod time;
3837
cfg_if::cfg_if! {
3938
if #[cfg(not(target_vendor = "uwp"))] {

0 commit comments

Comments
 (0)