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 "osal_thread.h" 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif /* __cplusplus */ 17 18 struct HdfThread { 19 struct OsalThread adapter; 20 bool status; 21 void (*ThreadEntry)(void *); 22 bool (*IsRunning)(); 23 void (*Start)(struct HdfThread *thread); 24 void (*Stop)(struct HdfThread *thread); 25 }; 26 27 void HdfThreadConstruct(struct HdfThread *thread); 28 void HdfThreadDestruct(struct HdfThread *thread); 29 struct HdfThread *HdfThreadNewInstance(void); 30 void HdfThreadFreeInstance(struct HdfThread *thread); 31 32 #ifdef __cplusplus 33 } 34 #endif /* __cplusplus */ 35 36 #endif /* HDF_THREAD_H */ 37 38