Skip to content

Commit 12dab46

Browse files
committed
remove unnecessary longjmp when task is last
Avoid jumping back to the scheduler after task1 completes, since it's the last scheduled task. Control can return naturally.
1 parent c402343 commit 12dab46

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Diff for: coro/coro.c

-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ void task1(void *arg)
137137

138138
printf("%s: complete\n", task->task_name);
139139
free(task);
140-
longjmp(sched, 1);
141140
}
142141

143142
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

0 commit comments

Comments
 (0)