TuyaOS
tal_semaphore.h
1
10#ifndef __TAL_SEMAPHORE_H__
11#define __TAL_SEMAPHORE_H__
12
13#include "tuya_cloud_types.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19typedef PVOID_T SEM_HANDLE;
20
21#define SEM_WAIT_FOREVER 0xFFFFffff
22
34OPERATE_RET tal_semaphore_create_init(SEM_HANDLE *handle, UINT_T sem_cnt, UINT_T sem_max);
35
46OPERATE_RET tal_semaphore_wait(SEM_HANDLE handle, UINT_T timeout);
47
57OPERATE_RET tal_semaphore_post(SEM_HANDLE handle);
58
68OPERATE_RET tal_semaphore_release(SEM_HANDLE handle);
69
70
80#define tal_semaphore_wait_forever(__handle) \
81 tal_semaphore_wait(__handle, SEM_WAIT_FOREVER)
82
83#ifdef __cplusplus
84}
85#endif /* __cplusplus */
86
87#endif
88