pub enum NotBlockable {
CurrentThreadRuntime,
BackgroundWorker,
}Expand description
A synchronous caller asked to block on an async operation from a thread where blocking cannot be made sound.
Both variants are the same defect seen through two executors: the calling
thread is one the awaited future needs in order to make progress, so parking
it parks the thing that would wake it. No blocking mechanism can fix that;
the caller has to await the async operation instead of blocking on it.
Variants§
CurrentThreadRuntime
A current-thread tokio runtime is entered on this thread. Parking it stops every task on that runtime, including whichever one holds the state the awaited future is waiting for.
BackgroundWorker
This thread is a background-facility worker — a callback band, the
delayed-callback timer, or the scanOnce worker
(crate::runtime::background). Each facility has a bounded worker set
and every unit of work it carries is enqueued for those workers, so a
parked worker is waiting for work only it could have run. On RTEMS
spawn routes here, which makes the callback bands the one other
place where parking is unsound.
Trait Implementations§
Source§impl Clone for NotBlockable
impl Clone for NotBlockable
Source§fn clone(&self) -> NotBlockable
fn clone(&self) -> NotBlockable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NotBlockable
Source§impl Debug for NotBlockable
impl Debug for NotBlockable
Source§impl Display for NotBlockable
impl Display for NotBlockable
impl Eq for NotBlockable
Source§impl Error for NotBlockable
impl Error for NotBlockable
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()