TuyaOS
uni_thread.h
浏览该文件的文档.
1
13#ifndef _UNI_THREAD_H
14#define _UNI_THREAD_H
15
16#include "tuya_cloud_types.h"
17#include "tal_thread.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#define MAX_THREAD_NAME_LEN 16
24
25typedef PVOID_T THRD_HANDLE;
26
27typedef INT_T THRD_STA;
28#define STATE_EMPTY 0 // thread is inited
29#define STATE_RUNNING 1 // thread is running
30#define STATE_STOP 2 // thread is stop
31#define STATE_DELETE 3 // thread delete status
32
33typedef unsigned int TRD_PRI;
34#define TRD_PRIO_0 5 // high
35#define TRD_PRIO_1 4
36#define TRD_PRIO_2 3
37#define TRD_PRIO_3 2
38#define TRD_PRIO_4 1
39#define TRD_PRIO_5 0
40#define TRD_PRIO_6 0 // low
41
43typedef THREAD_ENTER_CB P_CONSTRUCT_FUNC;
44typedef THREAD_EXIT_CB P_EXTRACT_FUNC;
45
46#define CreateAndStart(pThrdHandle, enter, exit, pThrdFunc, pThrdFuncArg, thrd_param) \
47 tal_thread_create_and_start(pThrdHandle, enter, exit, pThrdFunc, pThrdFuncArg, thrd_param)
48
49#define DeleteThrdHandle(thrdHandle) \
50 tal_thread_delete(thrdHandle)
51
52#define ThreadRunSelfSpace(thrdHandle, bl) \
53 tal_thread_is_self(thrdHandle, bl)
54
55#define GetThrdSta(thrdHandle) \
56 (THRD_STA)tal_thread_get_state(thrdHandle)
57
58#define DumpAllThrdWatermark \
59 tal_thread_dump_stack
60
61#ifdef __cplusplus
62}
63#endif /* __cplusplus */
64
65#endif
66
thread parameters
Definition: tal_thread.h:73