File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -431,13 +431,19 @@ impl State {
431431 }
432432
433433 pub async fn run < T > ( & self , future : impl Future < Output = T > ) -> T {
434- let mut ticker = Ticker :: new ( self ) ;
435-
436434 // A future that runs tasks forever.
437435 let run_forever = async {
438436 loop {
439437 for _ in 0 ..200 {
440- ticker. runnable ( ) . await . run ( ) ;
438+ // SAFETY: All UnsafeCell accesses to queue are tightly scoped, and because
439+ // `LocalExecutor` is !Send, there is no way to have concurrent access to the
440+ // values in `State`, including the queue field.
441+ match unsafe { & mut * self . queue . get ( ) } . pop_back ( ) {
442+ Some ( runnable) => {
443+ runnable. run ( ) ;
444+ } ,
445+ None => break ,
446+ }
441447 }
442448 future:: yield_now ( ) . await ;
443449 }
You can’t perform that action at this time.
0 commit comments