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> {
94
94
std:: mem:: forget ( self ) ;
95
95
96
96
{
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.
97
100
let active = unsafe { & mut * state. active . get ( ) } ;
98
101
if !active. is_empty ( ) {
99
102
// Reschedule all of the active tasks.
@@ -500,9 +503,11 @@ impl StaticLocalExecutor {
500
503
/// Returns a function that schedules a runnable task when it gets woken up.
501
504
fn schedule ( & ' static self ) -> impl Fn ( Runnable ) + ' static {
502
505
let state: & ' static LocalState = & self . state ;
503
- // TODO: If possible, push into the current local queue and notify the ticker.
504
506
move |runnable| {
505
507
{
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.
506
511
let queue = unsafe { & mut * state. queue . get ( ) } ;
507
512
queue. push_front ( runnable) ;
508
513
}
You can’t perform that action at this time.
0 commit comments