pub struct ThreadPtr(/* private fields */);Expand description
Type-safe wrapper around a raw pointer to a Zircon kernel Thread.
Implementations§
Source§impl ThreadPtr
impl ThreadPtr
Sourcepub const unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub const unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Creates a ThreadPtr from a raw pointer.
§Safety
The caller must ensure that ptr is a valid pointer to a live kernel thread.
Sourcepub unsafe fn resume(self)
pub unsafe fn resume(self)
Resumes execution of the thread.
§Safety
The caller must ensure the thread has not been joined or destroyed.
Sourcepub unsafe fn join(self, deadline: zx_instant_mono_t) -> Result<i32, Status>
pub unsafe fn join(self, deadline: zx_instant_mono_t) -> Result<i32, Status>
Joins the thread, waiting for it to exit.
Returns the thread’s return code on success.
§Safety
The caller must ensure that the thread has not been joined yet.
Sourcepub unsafe fn is_blocked(self) -> bool
pub unsafe fn is_blocked(self) -> bool
Checks if the thread is currently blocked.
§Safety
The caller must ensure that the thread pointer is still valid and the underlying thread has not been destroyed or joined.
Trait Implementations§
impl Copy for ThreadPtr
impl Eq for ThreadPtr
impl Send for ThreadPtr
impl StructuralPartialEq for ThreadPtr
impl Sync for ThreadPtr
Auto Trait Implementations§
impl Freeze for ThreadPtr
impl RefUnwindSafe for ThreadPtr
impl Unpin for ThreadPtr
impl UnsafeUnpin for ThreadPtr
impl UnwindSafe for ThreadPtr
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,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)