pub struct ExecGuard { /* private fields */ }Expand description
Holds the executor’s lock for its own lifetime: taken at
ExecGuard::acquire, given at drop. With no lock installed it holds
nothing.
Implementations§
Source§impl ExecGuard
impl ExecGuard
Sourcepub unsafe fn acquire(exec: *const Executor<'_>) -> Self
pub unsafe fn acquire(exec: *const Executor<'_>) -> Self
Take the lock installed on the executor at exec, BEFORE any reference
to that executor exists – the order that keeps a second thread’s
reference from overlapping this one.
§Safety
exec points at a live, initialised executor. Its lock field is read
without a reference: it is written only while no second thread can
reach the executor (super::Executor::set_exec_lock).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExecGuard
impl RefUnwindSafe for ExecGuard
impl Send for ExecGuard
impl Sync for ExecGuard
impl Unpin for ExecGuard
impl UnsafeUnpin for ExecGuard
impl UnwindSafe for ExecGuard
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