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_MESSAGE_LOOPER_H 10 #define HDF_MESSAGE_LOOPER_H 11 12 #include "osal_msg_queue.h" 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif /* __cplusplus */ 17 18 #define MESSAGE_STOP_LOOP (-1) 19 20 struct HdfMessageLooper { 21 struct HdfMessageQueue messageQueue; 22 void (*Start)(struct HdfMessageLooper *); 23 void (*Stop)(struct HdfMessageLooper *); 24 bool isRunning; 25 }; 26 27 void HdfMessageLooperConstruct(struct HdfMessageLooper *looper); 28 29 #ifdef __cplusplus 30 } 31 #endif /* __cplusplus */ 32 33 #endif /* HDF_MESSAGE_LOOPER_H */ 34