• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  /**
17  * @file task.h
18  *
19  * @brief Declares the task inner interfaces in C++.
20  *
21  * @since 10
22  * @version 1.0
23  */
24 #ifndef FFRT_INNER_API_CPP_TASK_H
25 #define FFRT_INNER_API_CPP_TASK_H
26 #include <vector>
27 #include <string>
28 #include <functional>
29 #include <memory>
30 #include "../c/task.h"
31 
32 namespace ffrt {
33 /**
34  * @brief Skips a task.
35  *
36  * @param handle Indicates a task handle.
37  * @return Returns <b>0</b> if the task is skipped;
38            returns <b>-1</b> otherwise.
39  * @since 10
40  * @version 1.0
41  */
skip(task_handle & handle)42 static inline int skip(task_handle &handle)
43 {
44     return ffrt_skip(handle);
45 }
46 
47 void sync_io(int fd);
48 
49 void set_trace_tag(const std::string& name);
50 
51 void clear_trace_tag();
52 } // namespace ffrt
53 #endif
54