• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025-2025 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 MOCK_FFRT_INNER_API_CPP_TASK_H
16 #define MOCK_FFRT_INNER_API_CPP_TASK_H
17 #include <cstdint>
18 #include "c/task_ext.h"
19 #include "cpp/task.h"
20 
21 namespace ffrt {
22 
skip(task_handle & handle)23 static inline int skip(task_handle &handle)
24 {
25     return 0;
26 }
27 
sync_io(int fd)28 inline void sync_io(int fd)
29 {}
30 
set_trace_tag(const char * name)31 inline void set_trace_tag(const char *name)
32 {}
33 
clear_trace_tag()34 inline void clear_trace_tag()
35 {}
36 
set_cgroup_attr(qos qos_,ffrt_os_sched_attr * attr)37 static inline int set_cgroup_attr(qos qos_, ffrt_os_sched_attr *attr)
38 {
39     return 0;
40 }
41 
restore_qos_config()42 static inline void restore_qos_config()
43 {}
44 
set_cpu_worker_max_num(qos qos_,uint32_t num)45 static inline int set_cpu_worker_max_num(qos qos_, uint32_t num)
46 {
47     return 0;
48 }
49 
notify_workers(qos qos_,int number)50 static inline void notify_workers(qos qos_, int number)
51 {}
52 
get_queue_id()53 static inline int64_t get_queue_id()
54 {
55     return 0;
56 }
57 
58 static inline int enable_worker_escape(uint64_t one_stage_interval_ms = 10, uint64_t two_stage_interval_ms = 100,
59     uint64_t three_stage_interval_ms = 1000, uint64_t one_stage_worker_num = 128, uint64_t two_stage_worker_num = 256)
60 {
61     return 0;
62 }
63 
disable_worker_escape()64 static inline void disable_worker_escape()
65 {}
66 
67 }  // namespace ffrt
68 #endif