• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 
16 #include "ffrt/ffrt_utils.h"
17 
18 namespace OHOS {
19 namespace MiscServices {
SubmitTask(const FFRTTask & task)20 void FFRTUtils::SubmitTask(const FFRTTask &task)
21 {
22     (void)task;
23 }
24 
SubmitQueueTasks(const std::vector<FFRTTask> & tasks,FFRTQueue & queue)25 void FFRTUtils::SubmitQueueTasks(const std::vector<FFRTTask> &tasks, FFRTQueue &queue)
26 {
27     (void)tasks;
28     (void)queue;
29 }
30 
SubmitDelayTask(FFRTTask & task,uint32_t delayMs,FFRTQueue & queue)31 FFRTHandle FFRTUtils::SubmitDelayTask(FFRTTask &task, uint32_t delayMs, FFRTQueue &queue)
32 {
33     (void)task;
34     (void)delayMs;
35     (void)queue;
36     return {};
37 }
38 
SubmitDelayTask(FFRTTask & task,uint32_t delayMs,std::shared_ptr<FFRTQueue> queue)39 FFRTHandle FFRTUtils::SubmitDelayTask(FFRTTask &task, uint32_t delayMs, std::shared_ptr<FFRTQueue> queue)
40 {
41     (void)task;
42     (void)delayMs;
43     (void)queue;
44     return {};
45 }
46 
SubmitTimeoutTask(const FFRTTask & task,uint32_t timeoutMs)47 bool FFRTUtils::SubmitTimeoutTask(const FFRTTask &task, uint32_t timeoutMs)
48 {
49     (void)task;
50     (void)timeoutMs;
51     return false;
52 }
53 
CancelTask(FFRTHandle & handle,FFRTQueue & queue)54 int FFRTUtils::CancelTask(FFRTHandle &handle, FFRTQueue &queue)
55 {
56     (void)handle;
57     (void)queue;
58     return 0;
59 }
60 
CancelTask(FFRTHandle & handle,std::shared_ptr<FFRTQueue> & queue)61 int FFRTUtils::CancelTask(FFRTHandle &handle, std::shared_ptr<FFRTQueue> &queue)
62 {
63     (void)handle;
64     (void)queue;
65     return 0;
66 }
67 
FFRTTimer()68 FFRTTimer::FFRTTimer() : queue_("ffrt_timer") {}
69 
FFRTTimer(const std::string & timer_name)70 FFRTTimer::FFRTTimer(const std::string &timer_name) : queue_(timer_name.c_str()) {}
71 
~FFRTTimer()72 FFRTTimer::~FFRTTimer()
73 {
74 }
75 
Clear()76 void FFRTTimer::Clear()
77 {
78 }
79 
CancelAllTimer()80 void FFRTTimer::CancelAllTimer()
81 {
82 }
83 
CancelTimer(const std::string & timerId)84 void FFRTTimer::CancelTimer(const std::string &timerId)
85 {
86     (void)timerId;
87 }
88 
SetTimer(const std::string & timerId,FFRTTask & task,uint32_t delayMs)89 void FFRTTimer::SetTimer(const std::string &timerId, FFRTTask &task, uint32_t delayMs)
90 {
91     (void)timerId;
92     (void)task;
93     (void)delayMs;
94 }
95 
GetTaskId(const std::string & timerId)96 uint32_t FFRTTimer::GetTaskId(const std::string &timerId)
97 {
98     (void)timerId;
99     return 0;
100 }
101 
CancelAllTimerInner()102 void FFRTTimer::CancelAllTimerInner()
103 {
104 }
105 
CancelTimerInner(const std::string & timerId)106 void FFRTTimer::CancelTimerInner(const std::string &timerId)
107 {
108     (void)timerId;
109 }
110 } // namespace MiscServices
111 } // namespace OHOS