More comments

This commit is contained in:
Stjepan Glavina 2020-10-05 11:27:31 +02:00
parent 8e74895133
commit d9459c8223
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ struct State {
impl Scheduler {
/// Spawns a task onto the scheduler.
///
/// Safety:
/// - `future` must be `Send` if another thread may poll or drop it.
/// - `future` must be `'static` or `Scheduler::destroy()` must be called before it expires.
pub(crate) unsafe fn spawn_unchecked<T>(
self: &Arc<Scheduler>,
future: impl Future<Output = T>,