pub(crate) fn in_worker<OP, R>(&self, op: OP) -> R
    where
        OP: FnOnce(&WorkerThread, bool) -> R + Send,
        R: Send,
    {
        unsafe {
            let worker_thread = WorkerThread::current();
            if worker_thread.is_null() {
                self.in_worker_cold(op)
            } else {
                // Perfectly valid to give them a `&T`: this is the
                // current thread, so we know the data structure won't be
                // invalidated until we return.
                op(&*worker_thread, false)
            }
        }
    }
/// If already in a worker-thread of this registry, just execute `op`.
/// Otherwise, inject `op` in this thread-pool. Either way, block until `op`
/// completes and return its return value. If `op` panics, that panic will
/// be propagated as well.  The second argument indicates `true` if injection
/// was performed, `false` if executed directly.
If already in a worker-thread of this registry, just execute `op`.
Otherwise, inject `op` in this thread-pool. Either way, block until `op`
completes and return its return value. If `op` panics, that panic will
be propagated as well.  The second argument indicates `true` if injection
was performed, `false` if executed directly.
If already in a worker - thread of this registry just execute ` op ` . Otherwise inject ` op ` in this thread - pool . Either way block until ` op ` completes and return its return value . If ` op ` panics that panic will be propagated as well . The second argument indicates ` true ` if injection was performed ` false ` if executed directly .
pub(crate) fn in_worker<OP, R>(&self, op: OP) -> R
    where
        OP: FnOnce(&WorkerThread, bool) -> R + Send,
        R: Send,
    {
        unsafe {
            let worker_thread = WorkerThread::current();
            if worker_thread.is_null() {
                self.in_worker_cold(op)
            } else {
                // Perfectly valid to give them a `&T`: this is the
                // current thread, so we know the data structure won't be
                // invalidated until we return.
                op(&*worker_thread, false)
            }
        }
    }
pub ( crate ) fn in_worker < OP , R > ( & self , op : OP ) -> R where OP : FnOnce ( & WorkerThread , bool ) -> R + Send , R : Send , { unsafe { let worker_thread = WorkerThread :: current ( ) ; if worker_thread . is_null ( ) { self . in_worker_cold ( op ) } else { // Perfectly valid to give them a `&T`: this is the // current thread, so we know the data structure won't be // invalidated until we return. op ( & * worker_thread , false ) } } }
If already in a worker-thread of this registry, just execute `op`.
If already in a worker - thread of this registry just execute ` op ` .
&self
op
OP
&self
op
OP