#[repr(C)]pub struct Thread {
pub name: String,
pub state: ThreadState,
/* private fields */
}
Expand description
An thread abstraction.
Fields§
§name: String
Thread name
state: ThreadState
State of the thread.
Implementations§
source§impl Thread
impl Thread
sourcepub fn park_current_and(f: impl FnOnce(ParkHandle))
pub fn park_current_and(f: impl FnOnce(ParkHandle))
Park the current threads and run the given closure.
sourcepub fn pin() -> ThreadPinGuard
pub fn pin() -> ThreadPinGuard
Pin current thread not to be scheduled by block .
When ThreadPinGuard
is dropped, the current thread is unpinned.
When you hold multiple ThreadPinGuard
, you MUST drops ThreadPinGuard
as a reverse order of creation.
Auto Trait Implementations§
impl RefUnwindSafe for Thread
impl !Send for Thread
impl !Sync for Thread
impl Unpin for Thread
impl UnwindSafe for Thread
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
const: unstable§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more