Implement status() for DefaultExecutor (#463)

This commit is contained in:
Stjepan Glavina
2018-07-05 10:19:49 -07:00
committed by Carl Lerche
parent 7fb579c667
commit b019532bc2
+14
View File
@@ -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 =====