Skip to content

Commit 9a5409d

Browse files
committed
Remove unnecessary longjmp
Avoid jumping back to the scheduler after task1 completes, since it's the last scheduled task. Control can return naturally.
1 parent c402343 commit 9a5409d

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

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)