Struct parking_lot_core::thread_parker::imp::ThreadParker

source ·
pub struct ThreadParker {
    futex: AtomicI32,
}

Fields§

§futex: AtomicI32

Implementations§

Trait Implementations§

source§

impl ThreadParkerT for ThreadParker

source§

type UnparkHandle = UnparkHandle

source§

const IS_CHEAP_TO_CONSTRUCT: bool = true

source§

fn new() -> ThreadParker

source§

unsafe fn prepare_park(&self)

Prepares the parker. This should be called before adding it to the queue.
source§

unsafe fn timed_out(&self) -> bool

Checks if the park timed out. This should be called while holding the queue lock after park_until has returned false.
source§

unsafe fn park(&self)

Parks the thread until it is unparked. This should be called after it has been added to the queue, after unlocking the queue.
source§

unsafe fn park_until(&self, timeout: Instant) -> bool

Parks the thread until it is unparked or the timeout is reached. This should be called after it has been added to the queue, after unlocking the queue. Returns true if we were unparked and false if we timed out.
source§

unsafe fn unpark_lock(&self) -> UnparkHandle

Locks the parker to prevent the target thread from exiting. This is necessary to ensure that thread-local ThreadData objects remain valid. This should be called while holding the queue lock.

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.