File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -766,7 +766,18 @@ impl RMain {
766
766
let stdin_reply_index = select. recv ( & stdin_reply_rx) ;
767
767
let kernel_request_index = select. recv ( & kernel_request_rx) ;
768
768
let tasks_interrupt_index = select. recv ( & tasks_interrupt_rx) ;
769
- let tasks_idle_index = select. recv ( & tasks_idle_rx) ;
769
+
770
+ // Don't process idle tasks in browser prompts. We currently don't want
771
+ // idle tasks (e.g. for srcref generation) to run when the call stack is
772
+ // empty. We could make this configurable though if needed, i.e. some
773
+ // idle tasks would be able to run in the browser. Those should be sent
774
+ // to a dedicated channel that would always be included in the set of
775
+ // recv channels.
776
+ let tasks_idle_index = if info. browser {
777
+ None
778
+ } else {
779
+ Some ( select. recv ( & tasks_idle_rx) )
780
+ } ;
770
781
771
782
loop {
772
783
// If an interrupt was signaled and we are in a user
@@ -846,7 +857,7 @@ impl RMain {
846
857
} ,
847
858
848
859
// An idle task woke us up
849
- i if i == tasks_idle_index => {
860
+ i if Some ( i ) == tasks_idle_index => {
850
861
let task = oper. recv ( & tasks_idle_rx) . unwrap ( ) ;
851
862
self . handle_task ( task) ;
852
863
} ,
You can’t perform that action at this time.
0 commit comments