File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -381,52 +381,44 @@ impl Scheduler {
381
381
match home {
382
382
& Some ( Sched ( ref home_handle) )
383
383
if home_handle. sched_id != this. sched_id ( ) => {
384
- 0
384
+ SendHome
385
385
}
386
386
& Some ( AnySched ) if this. run_anything => {
387
- 1
387
+ ResumeNow
388
388
}
389
389
& Some ( AnySched ) => {
390
- 2
390
+ Requeue
391
391
}
392
392
& Some ( Sched ( _) ) => {
393
- 3
393
+ ResumeNow
394
394
}
395
395
& None => {
396
- 4
396
+ Homeless
397
397
}
398
398
}
399
399
} ;
400
400
401
401
match action_id {
402
- 0 => {
402
+ SendHome => {
403
403
rtdebug ! ( "sending task home" ) ;
404
404
Scheduler :: send_task_home ( task) ;
405
405
Local :: put ( this) ;
406
406
return false ;
407
407
}
408
- 1 => {
408
+ ResumeNow => {
409
409
rtdebug ! ( "resuming now" ) ;
410
410
this. resume_task_immediately ( task) ;
411
411
return true ;
412
412
}
413
- 2 => {
413
+ Requeue => {
414
414
rtdebug ! ( "re-queueing" )
415
415
this. enqueue_task ( task) ;
416
416
Local :: put ( this) ;
417
417
return false ;
418
418
}
419
- 3 => {
420
- rtdebug ! ( "resuming now" ) ;
421
- this. resume_task_immediately ( task) ;
422
- return true ;
423
- }
424
- 4 => {
419
+ Homeless => {
425
420
rtabort ! ( "task home was None!" ) ;
426
421
}
427
- _ => {
428
- rtabort ! ( "literally, you should not be here" ) ;
429
- }
430
422
}
431
423
}
432
424
@@ -654,6 +646,14 @@ impl Scheduler {
654
646
}
655
647
}
656
648
649
+ // The cases for the below function.
650
+ enum ResumeAction {
651
+ SendHome ,
652
+ Requeue ,
653
+ ResumeNow ,
654
+ Homeless
655
+ }
656
+
657
657
impl SchedHandle {
658
658
pub fn send ( & mut self , msg : SchedMessage ) {
659
659
self . queue . push ( msg) ;
You can’t perform that action at this time.
0 commit comments