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 #ifndef TASK_ATTR_PRIVATE_H 16 #define TASK_ATTR_PRIVATE_H 17 #include <string> 18 #include "c/type_def_ext.h" 19 #include "cpp/task_ext.h" 20 #ifdef USE_OHOS_QOS 21 #include "qos.h" 22 #else 23 #include "staging_qos/sched/qos.h" 24 #endif 25 #include "eu/co_routine.h" 26 27 namespace ffrt { 28 class task_attr_private { 29 public: task_attr_private()30 task_attr_private() 31 : qos_(qos_default) 32 { 33 } 34 task_attr_private(const task_attr attr)35 explicit task_attr_private(const task_attr attr) 36 : qos_(attr.qos()), 37 name_(attr.name()), 38 delay_(attr.delay()), 39 timeout_(attr.timeout()), 40 prio_(attr.priority()) 41 { 42 } 43 44 int qos_; 45 std::string name_; 46 uint64_t delay_ = 0; 47 uint64_t timeout_ = 0; 48 bool notifyWorker_ = true; 49 bool isDelaying_ = false; 50 ffrt_queue_priority_t prio_ = ffrt_queue_priority_low; 51 bool taskLocal_ = false; 52 bool headInsert_ = false; 53 ffrt_function_header_t* timeoutCb_ = nullptr; 54 uint64_t stackSize_ = STACK_SIZE; 55 bool groupRoot_ = false; 56 }; 57 } 58 #endif 59