]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/ukschecoop: Remove invalid assertion
authorMichalis Pappas <michalis@unikraft.io>
Tue, 10 Dec 2024 09:10:00 +0000 (10:10 +0100)
committerUnikraft Bot <monkey@unikraft.io>
Thu, 12 Dec 2024 00:26:41 +0000 (00:26 +0000)
Remove an assertion for prev->s in schedcoop_schedule(),
as it is a valid case that uk_sched_yield() is called to
switch away from a terminated thread.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1550

lib/ukschedcoop/schedcoop.c

index b5a04568960cc0bb1e5c82f45bb4b00417a934cc..3e150c4c0467ef14ccadd435d2799d7368616995 100644 (file)
@@ -126,10 +126,8 @@ static void schedcoop_schedule(struct uk_sched *s)
         * interrupted at the return instruction. And therefore at safe point.
         */
        if (prev != next) {
-               if (next != &c->idle) {
-                       UK_ASSERT(prev->sched);
+               if (next != &c->idle)
                        uk_sched_stats_next_count_incr(s);
-               }
                uk_sched_thread_switch(next);
        }
 }