[][src]Trait flize::Shield

pub trait Shield<'a>: Clone + Debug {
    fn repin(&mut self);
fn repin_after<F, R>(&mut self, f: F) -> R
    where
        F: FnOnce() -> R
;
fn retire<F>(&self, f: F)
    where
        F: FnOnce() + 'a
; }

Universal methods for any shield implementation.

Required methods

fn repin(&mut self)

Attempt to synchronize the current thread to allow advancing the global epoch. This might be useful to call every once in a while if you plan on holding a Shield for an extended amount of time as to not stop garbage collection.

This is only effective if this is the only active shield created by this thread. Has no effect when called from an unprotected shield.

fn repin_after<F, R>(&mut self, f: F) -> R where
    F: FnOnce() -> R, 

Attempt to synchronize the current thread like Shield::repin but executing a closure during the time the Shield is temporarily deactivated.

If this method is called from an unprotected shield, the closure will be executed immediately without unpinning the thread.

fn retire<F>(&self, f: F) where
    F: FnOnce() + 'a, 

Schedule a closure for execution once no shield may hold a reference to an object unlinked with the current shield.

If this method is called from an unprotected shield, the closure will be executed immediately.

Loading content...

Implementors

impl<'a> Shield<'a> for FullShield<'a>[src]

impl<'a> Shield<'a> for ThinShield<'a>[src]

impl<'a> Shield<'a> for UnprotectedShield[src]

Loading content...