Skip to content

std: move thread into sys #145177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/std/src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub mod process;
pub mod random;
pub mod stdio;
pub mod sync;
pub mod thread;
pub mod thread_local;

// FIXME(117276): remove this, move feature implementations into individual
Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/pal/hermit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub mod futex;
pub mod os;
#[path = "../unsupported/pipe.rs"]
pub mod pipe;
pub mod thread;
pub mod time;

pub fn unsupported<T>() -> crate::io::Result<T> {
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/sgx/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64
let tls_guard = unsafe { tls.activate() };

if secondary {
let join_notifier = super::thread::Thread::entry();
let join_notifier = crate::sys::thread::Thread::entry();
drop(tls_guard);
drop(join_notifier);

Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/pal/sgx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod libunwind_integration;
pub mod os;
#[path = "../unsupported/pipe.rs"]
pub mod pipe;
pub mod thread;
pub mod thread_parking;
pub mod time;
pub mod waitqueue;
Expand Down
4 changes: 1 addition & 3 deletions library/std/src/sys/pal/solid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ pub mod itron {
pub mod error;
pub mod spin;
pub mod task;
pub mod thread;
pub mod thread_parking;
pub mod time;
use super::unsupported;
}

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

// SAFETY: must be called only once during runtime initialization.
Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/pal/teeos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
pub mod os;
#[path = "../unsupported/pipe.rs"]
pub mod pipe;
pub mod thread;
#[allow(non_upper_case_globals)]
#[path = "../unix/time.rs"]
pub mod time;
Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/pal/uefi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub mod helpers;
pub mod os;
#[path = "../unsupported/pipe.rs"]
pub mod pipe;
pub mod thread;
pub mod time;

#[cfg(test)]
Expand Down
66 changes: 0 additions & 66 deletions library/std/src/sys/pal/uefi/thread.rs

This file was deleted.

3 changes: 1 addition & 2 deletions library/std/src/sys/pal/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub mod os;
pub mod pipe;
pub mod stack_overflow;
pub mod sync;
pub mod thread;
pub mod thread_parking;
pub mod time;

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

unsafe fn sanitize_standard_fds() {
Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/pal/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub mod futex;
pub mod os;
#[path = "../unsupported/pipe.rs"]
pub mod pipe;
pub mod thread;
pub mod time;

#[path = "../unsupported/common.rs"]
Expand Down
212 changes: 0 additions & 212 deletions library/std/src/sys/pal/wasi/thread.rs

This file was deleted.

Loading
Loading