Skip to main content

QueueEntry

Struct QueueEntry 

pub struct QueueEntry { /* private fields */ }
Expand description

嵌入任务存储(task allocation)的本地链节点;不单独堆分配。

队列持有的Runnable暂存于ticket;这是一份有明确进出责任的自引用持有, 出队或队列析构(drop)必须取回它。普通控制句柄不能访问此槽或链接。

Implementations§

§

impl QueueEntry

取得内嵌链接地址;不导出任务(Task)状态。

§Safety

node须来自仍存活且未移动的QueueEntry,并持有对应队列访问权及保活责任。

§

impl QueueEntry

仅用于对应适配器(adapter)的逆向地址换算。

§Safety

link必须确由link_from_node取得,节点仍保活且属于当前队列;不能传任意指针。

§

impl QueueEntry

pub unsafe fn store( task: Runnable, owner: TaskOwnerId, ) -> Result<NonNull<Self>, Runnable>

把唯一可执行持有移入自身节点;失败原样返回。

§Safety

调用者须在owner线程,独占准备插入的节点,随后承担入链成功或回退取回责任。

§

impl QueueEntry

pub unsafe fn take(node: NonNull<Self>, owner: TaskOwnerId) -> Runnable

已安全摘链后取回唯一可执行持有,使链接可复用。

§Safety

须为本队列已完全摘除的保活节点,当前owner线程且只取一次。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.