Add more from the std

This commit is contained in:
2026-03-18 00:25:34 +01:00
parent fd0770f813
commit 9413fba265
51 changed files with 17246 additions and 26 deletions

View File

@@ -1,7 +1,23 @@
pub mod builder;
pub mod current;
pub mod functions;
pub mod id;
pub mod join_handle;
pub mod lifecycle;
pub mod local;
pub mod main_thread;
pub mod thread;
pub use crate::sys::thread::*;
use core::any::Any;
pub use crate::sys::thread::yield_now;
pub(crate) use current::current_or_unnamed;
pub use current::current_id;
pub use functions::sleep;
pub use id::ThreadId;
pub use local::LocalKey;
pub use thread::Thread;
pub(crate) use lifecycle::ThreadInit;
// Implementation details used by the thread_local!{} macro.
#[doc(hidden)]
@@ -11,14 +27,6 @@ pub mod local_impl {
pub use crate::sys::thread_local::*;
}
pub struct ThreadInit {
pub handle: Thread,
pub rust_start: Box<dyn FnOnce() + Send>,
}
impl ThreadInit {
/// Initialize the 'current thread' mechanism on this thread, returning the
/// Rust entry point.
pub fn init(self: Box<Self>) -> Box<dyn FnOnce() + Send> {
todo!()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(search_unbox)]
pub type Result<T> = crate::result::Result<T, Box<dyn Any + Send + 'static>>;