1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FFRT_TASK_IO_H 17 #define FFRT_TASK_IO_H 18 19 #include "internal_inc/types.h" 20 #include "sched/task_state.h" 21 #include "sched/interval.h" 22 #include "task_attr_private.h" 23 #include "util/slab.h" 24 #include "c/executor_task.h" 25 26 #ifdef FFRT_IO_TASK_SCHEDULER 27 namespace ffrt { 28 typedef struct { 29 ffrt_coroutine_ptr_t exec; 30 ffrt_function_t destroy; 31 void* data; 32 } ffrt_io_callable_t; 33 34 struct ffrt_executor_io_task: public ffrt_executor_task { ffrt_executor_io_taskffrt_executor_io_task35 ffrt_executor_io_task(const QoS &qos) : qos(qos) 36 { 37 type = ffrt_io_task; 38 } 39 40 QoS qos; 41 ffrt_io_callable_t work; 42 ExecTaskStatus status = ExecTaskStatus::ET_PENDING; 43 }; 44 } /* namespace ffrt */ 45 #endif 46 #endif