pub fn find_task<T>(local: &deque::Worker<T>, global: &deque::Injector<T>, stealers: &[Arc<deque::Stealer<T>>]) -> Option<T> {
    // Pop a task from the local queue, if not empty.
    local.pop().or_else(|| {
        // Otherwise, we need to look for a task elsewhere.
        iter::repeat_with(|| {
            // Try stealing a batch of tasks from the global queue.
            global
                .steal_batch_and_pop(local)
                // Or try stealing a task from one of the other executors.
                .or_else(|| stealers.iter().map(|s| s.steal()).collect())
        })
        // Loop while no task was stolen and any steal operation needs to be retried.
        .find(|s| !s.is_retry())
        // Extract the stolen task, if there is one.
        .and_then(|s| s.success())
    })
}
// generic function which finds a task
generic function which finds a task
generic function which finds a task
pub fn find_task<T>(local: &deque::Worker<T>, global: &deque::Injector<T>, stealers: &[Arc<deque::Stealer<T>>]) -> Option<T> {
    // Pop a task from the local queue, if not empty.
    local.pop().or_else(|| {
        // Otherwise, we need to look for a task elsewhere.
        iter::repeat_with(|| {
            // Try stealing a batch of tasks from the global queue.
            global
                .steal_batch_and_pop(local)
                // Or try stealing a task from one of the other executors.
                .or_else(|| stealers.iter().map(|s| s.steal()).collect())
        })
        // Loop while no task was stolen and any steal operation needs to be retried.
        .find(|s| !s.is_retry())
        // Extract the stolen task, if there is one.
        .and_then(|s| s.success())
    })
}
pub fn find_task < T > ( local : & deque :: Worker < T > , global : & deque :: Injector < T > , stealers : & [ Arc < deque :: Stealer < T > > ] ) -> Option < T > { // Pop a task from the local queue, if not empty. local . pop ( ) . or_else ( | | { // Otherwise, we need to look for a task elsewhere. iter :: repeat_with ( | | { // Try stealing a batch of tasks from the global queue. global . steal_batch_and_pop ( local ) // Or try stealing a task from one of the other executors. . or_else ( | | stealers . iter ( ) . map ( | s | s . steal ( ) ) . collect ( ) ) } ) // Loop while no task was stolen and any steal operation needs to be retried. . find ( | s | ! s . is_retry ( ) ) // Extract the stolen task, if there is one. . and_then ( | s | s . success ( ) ) } ) }
generic function which finds a task
generic function which finds a task
local
&deque::Worker<T>
global
&deque::Injector<T>
stealers
&[Arc<deque::Stealer<T>>]