Common process - adapter the semaphore api provide by OS
更多...
#include "tuya_cloud_types.h"
浏览源代码.
|
|
#define | TKL_SEM_WAIT_FOREVER 0xFFFFffff |
| |
|
|
typedef VOID_T * | TKL_SEM_HANDLE |
| |
Common process - adapter the semaphore api provide by OS
- 版本
- 0.1
- 日期
- 2020-11-09
- 版权所有
- Copyright 2021-2030 Tuya Inc. All Rights Reserved.
- 版本
- 0.1
- 日期
- 2021-08-24
- 版权所有
- Copyright 2021-2031 Tuya Inc. All Rights Reserved.
◆ tkl_semaphore_create_init()
| OPERATE_RET tkl_semaphore_create_init |
( |
TKL_SEM_HANDLE * |
handle, |
|
|
UINT_T |
sem_cnt, |
|
|
UINT_T |
sem_max |
|
) |
| |
Create semaphore
- 参数
-
| [out] | handle | semaphore handle |
| [in] | sem_cnt | semaphore init count |
| [in] | sem_max | semaphore max count |
- 注解
- This API is used for creating semaphore.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_semaphore_post()
| OPERATE_RET tkl_semaphore_post |
( |
CONST TKL_SEM_HANDLE |
handle | ) |
|
Post semaphore
- 参数
-
| [in] | handle | semaphore handle |
- 注解
- This API is used for posting semaphore.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_semaphore_release()
| OPERATE_RET tkl_semaphore_release |
( |
CONST TKL_SEM_HANDLE |
handle | ) |
|
Release semaphore
- 参数
-
| [in] | handle | semaphore handle |
- 注解
- This API is used for releasing semaphore.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_semaphore_wait()
| OPERATE_RET tkl_semaphore_wait |
( |
CONST TKL_SEM_HANDLE |
handle, |
|
|
UINT_T |
timeout |
|
) |
| |
Wait semaphore
- 参数
-
| [in] | handle | semaphore handle |
| [in] | timeout | wait timeout, SEM_WAIT_FOREVER means wait until get semaphore |
- 注解
- This API is used for waiting semaphore.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h