File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ impl LocalExecutor<'static> {
9494 std:: mem:: forget ( self ) ;
9595
9696 {
97+ // SAFETY: All UnsafeCell accesses to active are tightly scoped, and because
98+ // `LocalExecutor` is !Send, there is no way to have concurrent access to the
99+ // values in `State`, including the active field.
97100 let active = unsafe { & mut * state. active . get ( ) } ;
98101 if !active. is_empty ( ) {
99102 // Reschedule all of the active tasks.
@@ -500,9 +503,11 @@ impl StaticLocalExecutor {
500503 /// Returns a function that schedules a runnable task when it gets woken up.
501504 fn schedule ( & ' static self ) -> impl Fn ( Runnable ) + ' static {
502505 let state: & ' static LocalState = & self . state ;
503- // TODO: If possible, push into the current local queue and notify the ticker.
504506 move |runnable| {
505507 {
508+ // SAFETY: All UnsafeCell accesses to queue are tightly scoped, and because
509+ // `LocalExecutor` is !Send, there is no way to have concurrent access to the
510+ // values in `State`, including the queue field.
506511 let queue = unsafe { & mut * state. queue . get ( ) } ;
507512 queue. push_front ( runnable) ;
508513 }
You can’t perform that action at this time.
0 commit comments