Skip to content

Commit 474d08a

Browse files
committed
std: move thread into sys
1 parent 41f2b6b commit 474d08a

File tree

29 files changed

+828
-1005
lines changed

29 files changed

+828
-1005
lines changed

library/std/src/sys/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub mod process;
3030
pub mod random;
3131
pub mod stdio;
3232
pub mod sync;
33+
pub mod thread;
3334
pub mod thread_local;
3435

3536
// FIXME(117276): remove this, move feature implementations into individual

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub mod futex;
2525
pub mod os;
2626
#[path = "../unsupported/pipe.rs"]
2727
pub mod pipe;
28-
pub mod thread;
2928
pub mod time;
3029

3130
pub fn unsupported<T>() -> crate::io::Result<T> {

library/std/src/sys/pal/sgx/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64
6767
let tls_guard = unsafe { tls.activate() };
6868

6969
if secondary {
70-
let join_notifier = super::thread::Thread::entry();
70+
let join_notifier = crate::sys::thread::Thread::entry();
7171
drop(tls_guard);
7272
drop(join_notifier);
7373

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ mod libunwind_integration;
1313
pub mod os;
1414
#[path = "../unsupported/pipe.rs"]
1515
pub mod pipe;
16-
pub mod thread;
1716
pub mod thread_parking;
1817
pub mod time;
1918
pub mod waitqueue;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ pub mod itron {
1010
pub mod error;
1111
pub mod spin;
1212
pub mod task;
13-
pub mod thread;
1413
pub mod thread_parking;
1514
pub mod time;
16-
use super::unsupported;
1715
}
1816

1917
// `error` is `pub(crate)` so that it can be accessed by `itron/error.rs` as
@@ -22,7 +20,7 @@ pub(crate) mod error;
2220
pub mod os;
2321
#[path = "../unsupported/pipe.rs"]
2422
pub mod pipe;
25-
pub use self::itron::{thread, thread_parking};
23+
pub use self::itron::thread_parking;
2624
pub mod time;
2725

2826
// SAFETY: must be called only once during runtime initialization.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
pub mod os;
1010
#[path = "../unsupported/pipe.rs"]
1111
pub mod pipe;
12-
pub mod thread;
1312
#[allow(non_upper_case_globals)]
1413
#[path = "../unix/time.rs"]
1514
pub mod time;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub mod helpers;
1717
pub mod os;
1818
#[path = "../unsupported/pipe.rs"]
1919
pub mod pipe;
20-
pub mod thread;
2120
pub mod time;
2221

2322
#[cfg(test)]

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

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub mod os;
1717
pub mod pipe;
1818
pub mod stack_overflow;
1919
pub mod sync;
20-
pub mod thread;
2120
pub mod thread_parking;
2221
pub mod time;
2322

@@ -55,7 +54,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
5554
// thread-id for the main thread and so renaming the main thread will rename the
5655
// process and we only want to enable this on platforms we've tested.
5756
if cfg!(target_vendor = "apple") {
58-
thread::Thread::set_name(&c"main");
57+
crate::sys::thread::set_name(c"main");
5958
}
6059

6160
unsafe fn sanitize_standard_fds() {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub mod futex;
2020
pub mod os;
2121
#[path = "../unsupported/pipe.rs"]
2222
pub mod pipe;
23-
pub mod thread;
2423
pub mod time;
2524

2625
#[path = "../unsupported/common.rs"]

0 commit comments

Comments
 (0)