From 757a39bfde2a8a34b4d2f210b86069c4ea122f27 Mon Sep 17 00:00:00 2001 From: wanghuachen <513239407@qq.com> Date: Tue, 8 Aug 2023 11:19:50 +0800 Subject: [PATCH] rust Signed-off-by: wanghuachen <513239407@qq.com> --- interfaces/inner_api/c/executor_task.h | 2 +- interfaces/kits/c/type_def.h | 1 + src/core/task.cpp | 2 +- src/eu/cpu_monitor.cpp | 3 ++- src/sched/execute_ctx.h | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/interfaces/inner_api/c/executor_task.h b/interfaces/inner_api/c/executor_task.h index 95301d9..8918d2b 100644 --- a/interfaces/inner_api/c/executor_task.h +++ b/interfaces/inner_api/c/executor_task.h @@ -42,7 +42,7 @@ FFRT_C_API int ffrt_executor_task_cancel(ffrt_executor_task_t *taask, const ffrt FFRT_C_API int ffrt_poller_register(int fd, uint32_t events, void* data, void(*cb)(void*, uint32_t)); FFRT_C_API int ffrt_poller_deregister(int fd); FFRT_C_API int ffrt_poller_resgister_timerfunc(int(*timerFunc)()); -FFRT_C_API int ffrt_poller_wakeup(); +FFRT_C_API void ffrt_poller_wakeup(); FFRT_C_API void ffrt_submit_coroutine(void* co, ffrt_coroutine_ptr_t exec, ffrt_function_ptr_t destroy, const ffrt_deps_t* in_deps, const ffrt_deps_t* out_deps, const ffrt_task_attr_t* attr); diff --git a/interfaces/kits/c/type_def.h b/interfaces/kits/c/type_def.h index bd59127..87aef5f 100644 --- a/interfaces/kits/c/type_def.h +++ b/interfaces/kits/c/type_def.h @@ -71,6 +71,7 @@ typedef int ffrt_qos_t; */ typedef void(*ffrt_function_t)(void*); typedef void(*ffrt_function_ptr_t)(void*); +typedef ffrt_coroutine_ret_t(*ffrt_coroutine_ptr_t)(void*); typedef struct { /** Function used to execute a task. */ ffrt_function_t exec; diff --git a/src/core/task.cpp b/src/core/task.cpp index 037b250..06d332e 100644 --- a/src/core/task.cpp +++ b/src/core/task.cpp @@ -252,7 +252,7 @@ void ffrt_task_handle_destroy(ffrt_task_handle_t handle) #ifdef FFRT_IO_TASK_SCHEDULER ffrt_executor_task_t* task = (ffrt_executor_task_t*)handle; if (task->type == ffrt_io_task) { - ffrt::ffrt_executor_io_task* io_task = (ffrt::ffrt_exxcutor_io_task); + ffrt::ffrt_executor_io_task* io_task = (ffrt::ffrt_executor_io_task*)task; io_task->freeMem(); return; } diff --git a/src/eu/cpu_monitor.cpp b/src/eu/cpu_monitor.cpp index f4d946f..0215009 100644 --- a/src/eu/cpu_monitor.cpp +++ b/src/eu/cpu_monitor.cpp @@ -19,6 +19,7 @@ #include #include #include +#include "sync/poller.h" #include "sched/scheduler.h" #include "eu/wgcm.h" #include "eu/execute_unit.h" @@ -280,7 +281,7 @@ void CPUMonitor::Poke(const QoS& qos) } else { #ifdef FFRT_IO_TASK_SCHEDULER if (workerCtrl.pollWaitFlag) { - PollerProxy::Instance()->GetPoller(qos).Wakeup(); + PollerProxy::Instance()->GetPoller(qos).WakeUp(); } #endif workerCtrl.lock.unlock(); diff --git a/src/sched/execute_ctx.h b/src/sched/execute_ctx.h index 9dbc866..8332ca4 100644 --- a/src/sched/execute_ctx.h +++ b/src/sched/execute_ctx.h @@ -25,6 +25,7 @@ #ifdef FFRT_IO_TASK_SCHEDULER #include "queue/queue.h" #include "c/type_def.h" +#include "c/executor_task.h" #endif namespace ffrt {