pub(crate) fn register(&self, dynamic: DynamicFuture<'futures>) -> Option<TaskKey> {
        let suspended = dynamic.get_stop_reason() == StopReason::Suspended;
        let key = self.ctrl.registry.insert(dynamic); //won't realloc other futures because it uses ChunkSlab
        if let Some(key) = key {
            if suspended {
                //increase count cause added task was suspended
                self.ctrl.inc_suspended();
            } else {
                self.enqueue_runnable(key, false); //first ever enqueue of this task
            }
        }
        key
    }
//safe to call from inside task because chunkslab never moves futures.
safe to call from inside task because chunkslab never moves futures.
safe to call from inside task because chunkslab never moves futures .
pub(crate) fn register(&self, dynamic: DynamicFuture<'futures>) -> Option<TaskKey> {
        let suspended = dynamic.get_stop_reason() == StopReason::Suspended;
        let key = self.ctrl.registry.insert(dynamic); //won't realloc other futures because it uses ChunkSlab
        if let Some(key) = key {
            if suspended {
                //increase count cause added task was suspended
                self.ctrl.inc_suspended();
            } else {
                self.enqueue_runnable(key, false); //first ever enqueue of this task
            }
        }
        key
    }
pub ( crate ) fn register ( & self , dynamic : DynamicFuture < ' futures > ) -> Option < TaskKey > { let suspended = dynamic . get_stop_reason ( ) == StopReason :: Suspended ; let key = self . ctrl . registry . insert ( dynamic ) ; //won't realloc other futures because it uses ChunkSlab if let Some ( key ) = key { if suspended { //increase count cause added task was suspended self . ctrl . inc_suspended ( ) ; } else { self . enqueue_runnable ( key , false ) ; //first ever enqueue of this task } } key }
safe to call from inside task because chunkslab never moves futures.
safe to call from inside task because chunkslab never moves futures .
&self
dynamic
DynamicFuture<'futures>
&self
dynamic
DynamicFuture<'futures>