pub struct CurrentThreadOwnerHandle(/* private fields */);Expand description
Opaque pointer to the Arc-backed scheduler core of the current thread.
This value is useful only as part of a runtime-provided
CurrentThreadPublication. The scheduler may acquire a strong handle
from it only while a preemption pin proves that the published thread is
still current and therefore retains its owner-side strong reference.
Implementations§
Source§impl CurrentThreadOwnerHandle
impl CurrentThreadOwnerHandle
Sourcepub const unsafe fn from_raw(raw: usize) -> Self
pub const unsafe fn from_raw(raw: usize) -> Self
Creates a handle from the runtime-owned opaque value.
§Safety
A non-zero raw value must identify a live runtime-owned object
or resource of this exact handle type. The caller must uphold all
provenance, lifetime, pinning, aliasing, and ownership invariants
required by operations that consume or dereference the handle.
Use Self::NONE for the absent-handle sentinel.
ⓘ
use ax_task::runtime::switch::CurrentThreadOwnerHandle;
let _handle = CurrentThreadOwnerHandle::from_raw(1);Trait Implementations§
Source§impl Clone for CurrentThreadOwnerHandle
impl Clone for CurrentThreadOwnerHandle
Source§fn clone(&self) -> CurrentThreadOwnerHandle
fn clone(&self) -> CurrentThreadOwnerHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CurrentThreadOwnerHandle
Source§impl Debug for CurrentThreadOwnerHandle
impl Debug for CurrentThreadOwnerHandle
impl Eq for CurrentThreadOwnerHandle
Source§impl Hash for CurrentThreadOwnerHandle
impl Hash for CurrentThreadOwnerHandle
Source§impl PartialEq for CurrentThreadOwnerHandle
impl PartialEq for CurrentThreadOwnerHandle
impl StructuralPartialEq for CurrentThreadOwnerHandle
Auto Trait Implementations§
impl Freeze for CurrentThreadOwnerHandle
impl RefUnwindSafe for CurrentThreadOwnerHandle
impl Send for CurrentThreadOwnerHandle
impl Sync for CurrentThreadOwnerHandle
impl Unpin for CurrentThreadOwnerHandle
impl UnsafeUnpin for CurrentThreadOwnerHandle
impl UnwindSafe for CurrentThreadOwnerHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more