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

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

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

浏览源代码.

类型定义

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

函数说明

◆ 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]threadthread handle
[in]namethread name
[in]stack_sizestack size of thread
[in]prioritypriority of thread
[in]functhe main thread process function
[in]argthe 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.)

参数
[in]threadthread handle
返回
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

参数
[out]threadthread 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]threadthread handle, If NULL indicates the current thread
[in]prioritythread 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]threadthread handle
[out]watermarkwatermark 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]threadthread handle
[out]is_selfis 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

参数
[in]threadthread handle
注解
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]threadthread handle, If NULL indicates the current thread
[in]prioritythread 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

参数
[in]namethread name
注解
This API is used to set name of self thread.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h