File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -421,10 +421,6 @@ uint32_t task_switch(uint32_t esp) {
421421 old_thread -> nice = 0 ;
422422 } else {
423423 // Task still has some time left to run
424- tss .esp = old_thread -> esp ;
425- tss .esp0 = old_thread -> kernel_stack ;
426- tss .ss = old_thread -> ss ;
427-
428424 ODA .ts_flag = true;
429425 timefreeze = false;
430426 return old_thread -> esp ;
@@ -450,6 +446,14 @@ uint32_t task_switch(uint32_t esp) {
450446 }
451447 }
452448
449+ // No thread to run found
450+ if (old_thread -> parent == doNothing_task ) {
451+ // doNothing task is already running, no need to switch to it
452+ ODA .ts_flag = true;
453+ timefreeze = false;
454+ return old_thread -> esp ;
455+ }
456+
453457 current_thread = list_getElement (doNothing_task -> threads , 1 );
454458
455459 found_new_task :
You can’t perform that action at this time.
0 commit comments