• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 GAP_TASK_INTERNAL_H
17 #define GAP_TASK_INTERNAL_H
18 
19 #include "event.h"
20 
21 #define WAIT_TIME (-1)
22 
23 typedef struct {
24     Event *event;
25     void *ctx;
26     void (*func)(void *);
27 } GapRunTaskBlockInfo;
28 
29 typedef struct {
30     void (*free)(void *);
31     void *ctx;
32     void (*func)(void *);
33 } GapRunTaskUnBlockInfo;
34 
35 typedef struct {
36     int result;
37 } GapGeneralVoidInfo;
38 
39 typedef struct {
40     int result;
41     void *pointer;
42 } GapGeneralPointerInfo;
43 
44 typedef struct {
45     int result;
46     void *callback;
47     void *context;
48 } GapGeneralCallbackInfo;
49 
50 void GapInTaskProcess(void *ctx);
51 int GapRunTaskBlockProcess(void (*func)(void *), void *ctx);
52 int GapRunTaskUnBlockProcess(void (*func)(void *), void *ctx, void (*free)(void *));
53 
54 #endif
55