cpp_thread.h
浏览该文件的文档.
1 /*
2  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
3  */
4 
5 #include <stdint.h>
6 #include <k_api.h>
7 
12 namespace AOS {
13 
14 #define Thread_WAIT_FOREVER 0xFFFFFFFFU
15 
21  class thread
22  {
23  public:
24 #if (RHINO_CONFIG_KOBJ_DYN_ALLOC > 0)
25 
37  kstat_t create(const name_t *name, void *arg, uint8_t prio,
38  tick_t ticks, size_t stack_size, task_entry_t entry,
39  uint8_t autorun);
40 
41  thread(const name_t *name, void *arg, uint8_t prio,
42  tick_t ticks, size_t stack_size, task_entry_t entry, uint8_t autorun);
43 
44 
45  thread();
46 
47 
48 #if (RHINO_CONFIG_CPU_NUM > 1)
49 
62  kstat_t create_smp(const name_t *name, void *arg, uint8_t prio,
63  tick_t ticks, size_t stack_size, task_entry_t entry,
64  uint8_t cpu_num, uint8_t autorun);
65 
66 #endif
67 
73  kstat_t terminate(void);
74  ~thread(void);
75 
76 #endif
77 
83  kstat_t start(void);
84 
90  kstat_t stop(void);
91 
97  kstat_t sleep(uint32_t millisec);
98 
104  kstat_t yield(void);
105 
111  ktask_t *self(void);
112 
120  kstat_t prio_change(uint8_t pri);
121 
122 #if (RHINO_CONFIG_CPU_NUM > 1)
123 
129  kstat_t cpu_bind(uint8_t cpu_num);
130 
136  kstat_t cpu_unbind(void);
137 
138 #endif
139 
140  private:
144  ktask_t *p_thread_def;
145  };
146 
147 }
thread Class.
Definition: cpp_thread.h:22
kstat_t stop(void)
kstat_t sleep(uint32_t millisec)
kstat_t yield(void)
kstat_t prio_change(uint8_t pri)
kstat_t start(void)
Definition: cpp_mutex.h:21