Common process - adapter the thread api provide by OS
更多...
#include "tuya_cloud_types.h"
浏览源代码.
|
|
typedef VOID_T(* | THREAD_FUNC_T) (VOID_T *) |
| |
|
typedef VOID_T * | TKL_THREAD_HANDLE |
| |
|
| OPERATE_RET | tkl_thread_create (TKL_THREAD_HANDLE *thread, CONST CHAR_T *name, UINT_T stack_size, UINT_T priority, CONST THREAD_FUNC_T func, VOID_T *CONST arg) |
| | Create thread 更多...
|
| |
| OPERATE_RET | tkl_thread_diagnose (TKL_THREAD_HANDLE thread) |
| | Diagnose the thread(dump task stack, etc.) 更多...
|
| |
| OPERATE_RET | tkl_thread_get_id (TKL_THREAD_HANDLE *thread) |
| | Get the thread thread handle 更多...
|
| |
| OPERATE_RET | tkl_thread_get_priority (TKL_THREAD_HANDLE thread, INT_T *priority) |
| | Get thread priority 更多...
|
| |
| OPERATE_RET | tkl_thread_get_watermark (CONST TKL_THREAD_HANDLE thread, UINT_T *watermark) |
| | Get the thread stack's watermark 更多...
|
| |
| OPERATE_RET | tkl_thread_is_self (TKL_THREAD_HANDLE thread, BOOL_T *is_self) |
| | Check thread is self thread 更多...
|
| |
| OPERATE_RET | tkl_thread_release (CONST TKL_THREAD_HANDLE thread) |
| | Terminal thread and release thread resources 更多...
|
| |
| OPERATE_RET | tkl_thread_set_priority (TKL_THREAD_HANDLE thread, INT_T priority) |
| | Set thread priority 更多...
|
| |
| OPERATE_RET | tkl_thread_set_self_name (CONST CHAR_T *name) |
| | Set name of self thread 更多...
|
| |
Common process - adapter the thread api provide by OS
- 版本
- 0.1
- 日期
- 2020-11-09
- 版权所有
- Copyright 2021-2030 Tuya Inc. All Rights Reserved.
◆ tkl_thread_create()
| OPERATE_RET tkl_thread_create |
( |
TKL_THREAD_HANDLE * |
thread, |
|
|
CONST CHAR_T * |
name, |
|
|
UINT_T |
stack_size, |
|
|
UINT_T |
priority, |
|
|
CONST THREAD_FUNC_T |
func, |
|
|
VOID_T *CONST |
arg |
|
) |
| |
Create thread
- 参数
-
| [out] | thread | thread handle |
| [in] | name | thread name |
| [in] | stack_size | stack size of thread |
| [in] | priority | priority of thread |
| [in] | func | the main thread process function |
| [in] | arg | the args of the func, can be null |
- 注解
- This API is used for creating thread.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_thread_diagnose()
| OPERATE_RET tkl_thread_diagnose |
( |
TKL_THREAD_HANDLE |
thread | ) |
|
Diagnose the thread(dump task stack, etc.)
- 参数
-
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_thread_get_id()
| OPERATE_RET tkl_thread_get_id |
( |
TKL_THREAD_HANDLE * |
thread | ) |
|
Get the thread thread handle
- 参数
-
- 注解
- This API is used to get the thread handle.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_thread_get_priority()
| OPERATE_RET tkl_thread_get_priority |
( |
TKL_THREAD_HANDLE |
thread, |
|
|
INT_T * |
priority |
|
) |
| |
Get thread priority
- 参数
-
| [in] | thread | thread handle, If NULL indicates the current thread |
| [in] | priority | thread priority |
- 注解
- This API is used to get thread priority.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_thread_get_watermark()
| OPERATE_RET tkl_thread_get_watermark |
( |
CONST TKL_THREAD_HANDLE |
thread, |
|
|
UINT_T * |
watermark |
|
) |
| |
Get the thread stack's watermark
- 参数
-
| [in] | thread | thread handle |
| [out] | watermark | watermark in Bytes |
- 注解
- This API is used to get the thread stack's watermark.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_thread_is_self()
| OPERATE_RET tkl_thread_is_self |
( |
TKL_THREAD_HANDLE |
thread, |
|
|
BOOL_T * |
is_self |
|
) |
| |
Check thread is self thread
- 参数
-
| [in] | thread | thread handle |
| [out] | is_self | is self thread or not |
- 注解
- This API is used to check thread is self thread.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_thread_release()
| OPERATE_RET tkl_thread_release |
( |
CONST TKL_THREAD_HANDLE |
thread | ) |
|
Terminal thread and release thread resources
- 参数
-
- 注解
- This API is used to terminal thread and release thread resources.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_thread_set_priority()
| OPERATE_RET tkl_thread_set_priority |
( |
TKL_THREAD_HANDLE |
thread, |
|
|
INT_T |
priority |
|
) |
| |
Set thread priority
- 参数
-
| [in] | thread | thread handle, If NULL indicates the current thread |
| [in] | priority | thread priority |
- 注解
- This API is used to Set thread priority.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ tkl_thread_set_self_name()
| OPERATE_RET tkl_thread_set_self_name |
( |
CONST CHAR_T * |
name | ) |
|
Set name of self thread
- 参数
-
- 注解
- This API is used to set name of self thread.
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h