pub fn execute<F>(&self, f: F)
    where
        F: FnOnce() + Send + 'scope,
    {
        self.state.tokens_outstanding.fetch_add(1, Ordering::AcqRel);

        let mut s = Sentinel {
            successfully_finished: false,
            state: &self.state as *const _,
        };
        let b = unsafe {
            mem::transmute::<Thunk<'scope>, Thunk<'static>>(Box::new(move || {
                f();
                s.successfully_finished = true;
                drop(s);
            }))
        };

        self.pool.execute(b);
    }
/// Execute a job on the threadpool.
///
/// The body of the closure will be send to one of the
/// internal threads, and this method itself will not wait
/// for its completion.
Execute a job on the threadpool.
The body of the closure will be send to one of the
internal threads, and this method itself will not wait
for its completion.
Execute a job on the threadpool . The body of the closure will be send to one of the internal threads and this method itself will not wait for its completion .
pub fn execute<F>(&self, f: F)
    where
        F: FnOnce() + Send + 'scope,
    {
        self.state.tokens_outstanding.fetch_add(1, Ordering::AcqRel);
        let mut s = Sentinel {
            successfully_finished: false,
            state: &self.state as *const _,
        };
        let b = unsafe {
            mem::transmute::<Thunk<'scope>, Thunk<'static>>(Box::new(move || {
                f();
                s.successfully_finished = true;
                drop(s);
            }))
        };
        self.pool.execute(b);
    }
pub fn execute < F > ( & self , f : F ) where F : FnOnce ( ) + Send + ' scope , { self . state . tokens_outstanding . fetch_add ( 1 , Ordering :: AcqRel ) ; let mut s = Sentinel { successfully_finished : false , state : & self . state as * const _ , } ; let b = unsafe { mem :: transmute :: < Thunk < ' scope > , Thunk < ' static > > ( Box :: new ( move | | { f ( ) ; s . successfully_finished = true ; drop ( s ) ; } ) ) } ; self . pool . execute ( b ) ; }
Execute a job on the threadpool.
Execute a job on the threadpool .
&self
f
F
&self
f
F