Struct parking_lot_core::thread_parker::imp::ThreadParker
source · pub struct ThreadParker {
futex: AtomicI32,
}
Fields§
§futex: AtomicI32
Implementations§
source§impl ThreadParker
impl ThreadParker
fn futex_wait(&self, ts: Option<timespec>)
Trait Implementations§
source§impl ThreadParkerT for ThreadParker
impl ThreadParkerT for ThreadParker
type UnparkHandle = UnparkHandle
const IS_CHEAP_TO_CONSTRUCT: bool = true
fn new() -> ThreadParker
source§unsafe fn prepare_park(&self)
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
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)
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
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
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§
impl !Freeze for ThreadParker
impl RefUnwindSafe for ThreadParker
impl Send for ThreadParker
impl Sync for ThreadParker
impl Unpin for ThreadParker
impl UnwindSafe for ThreadParker
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