• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef HDF_THREAD_H
10 #define HDF_THREAD_H
11 
12 #include <stdint.h>
13 #include "osal_thread.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
18 
19 struct HdfThread {
20     struct OsalThread adapter;
21     bool status;
22     void (*ThreadEntry)(void *);
23     bool (*IsRunning)();
24     void (*Start)(struct HdfThread *thread);
25     void (*Stop)(struct HdfThread *thread);
26 };
27 
28 void HdfThreadConstruct(struct HdfThread *thread);
29 void HdfThreadDestruct(struct HdfThread *thread);
30 struct HdfThread *HdfThreadNewInstance(void);
31 void HdfThreadFreeInstance(struct HdfThread *instance);
32 
33 #ifdef __cplusplus
34 }
35 #endif /* __cplusplus */
36 
37 #endif /* HDF_THREAD_H */
38 
39