mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-07 00:00:09 +02:00
Implement status() for DefaultExecutor (#463)
This commit is contained in:
committed by
Carl Lerche
parent
7fb579c667
commit
b019532bc2
@@ -79,6 +79,20 @@ impl super::Executor for DefaultExecutor {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn status(&self) -> Result<(), SpawnError> {
|
||||
EXECUTOR.with(|current_executor| {
|
||||
match current_executor.get() {
|
||||
Some(executor) => {
|
||||
let executor = unsafe { &mut *executor };
|
||||
executor.status()
|
||||
}
|
||||
None => {
|
||||
Err(SpawnError::shutdown())
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// ===== global spawn fns =====
|
||||
|
||||
Reference in New Issue
Block a user