Function rayon_core::registry::in_worker
source ยท pub(crate) fn in_worker<OP, R>(op: OP) -> R
Expand description
If already in a worker-thread, just execute op
. Otherwise,
execute op
in the default 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.