TuyaOS
宏定义 | 类型定义 | 函数
tkl_semaphore.h 文件参考

Common process - adapter the semaphore api provide by OS 更多...

#include "tuya_cloud_types.h"
tkl_semaphore.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define TKL_SEM_WAIT_FOREVER   0xFFFFffff
 

类型定义

typedef VOID_T * TKL_SEM_HANDLE
 

函数

OPERATE_RET tkl_semaphore_create_init (TKL_SEM_HANDLE *handle, UINT_T sem_cnt, UINT_T sem_max)
 Create semaphore 更多...
 
OPERATE_RET tkl_semaphore_post (CONST TKL_SEM_HANDLE handle)
 Post semaphore 更多...
 
OPERATE_RET tkl_semaphore_release (CONST TKL_SEM_HANDLE handle)
 Release semaphore 更多...
 
OPERATE_RET tkl_semaphore_wait (CONST TKL_SEM_HANDLE handle, UINT_T timeout)
 Wait semaphore 更多...
 

详细描述

Common process - adapter the semaphore api provide by OS

版本
0.1
日期
2020-11-09
版本
0.1
日期
2021-08-24

函数说明

◆ 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]handlesemaphore handle
[in]sem_cntsemaphore init count
[in]sem_maxsemaphore 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]handlesemaphore 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]handlesemaphore 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]handlesemaphore handle
[in]timeoutwait 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