From 449e4d2eb20fbc189d3b348b5da851e684b7b72d Mon Sep 17 00:00:00 2001 From: vityaman Date: Thu, 21 Nov 2024 11:13:09 +0300 Subject: [PATCH] rename --- source/coroed/api/task.h | 6 +++--- source/coroed/sched/schedy.c | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/coroed/api/task.h b/source/coroed/api/task.h index 6db2abf..3e5d09a 100644 --- a/source/coroed/api/task.h +++ b/source/coroed/api/task.h @@ -23,9 +23,9 @@ void tasks_wait(); void tasks_print_statistics(); void tasks_destroy(); -void task_yield(struct task* task); -void task_exit(struct task* task); -void task_submit(struct task* parent, uthread_routine entry, void* argument); +void task_yield(struct task* caller); +void task_exit(struct task* caller); +void task_submit(struct task* caller, uthread_routine entry, void* argument); #define TASK_DECLARE(name, type, argument) \ void task_body_##name(struct task* __self, type* argument); /* NOLINT */ \ diff --git a/source/coroed/sched/schedy.c b/source/coroed/sched/schedy.c index 82a1ad4..773d36e 100644 --- a/source/coroed/sched/schedy.c +++ b/source/coroed/sched/schedy.c @@ -178,17 +178,17 @@ void sched_cancel(struct task* task) { task->state = UTHREAD_CANCELLED; } -void task_yield(struct task* task) { - sched_switch_to_scheduler(task); +void task_yield(struct task* caller) { + sched_switch_to_scheduler(caller); } -void task_exit(struct task* task) { - sched_cancel(task); - task_yield(task); +void task_exit(struct task* caller) { + sched_cancel(caller); + task_yield(caller); } -void task_submit(struct task* parent, uthread_routine entry, void* argument) { - (void)parent; +void task_submit(struct task* caller, uthread_routine entry, void* argument) { + (void)caller; sched_submit(*entry, argument); }