Lines Matching refs:thread
31 #define THREAD_T(thread) ((thread_t *)thread) argument
153 thread_t *thread; in thread_run() local
154 thread = THREAD_T(parameter); in thread_run()
160 thread->status = SUSPEND_LOCK; in thread_run()
161 TRACE("pid <%08x> stop on sem...\n", (unsigned int)(thread->pthread)); in thread_run()
162 sem_wait(&thread->sem); in thread_run()
165 TRACE("pid <%08x> tid <%s> starts...\n", (unsigned int)(thread->pthread), in thread_run()
167 thread->rtthread = tid; in thread_run()
168 thread->task(thread->para); in thread_run()
169 TRACE("pid <%08x> tid <%s> exit...\n", (unsigned int)(thread->pthread), in thread_run()
171 thread->exit(); in thread_run()
183 thread_t *thread, void *task, void *parameter, void *pexit) in thread_create() argument
188 thread->task = task; in thread_create()
189 thread->para = parameter; in thread_create()
190 thread->exit = pexit; in thread_create()
192 if (sem_init(&thread->sem, 0, 0) != 0) in thread_create()
202 res = pthread_create(&thread->pthread, &attr, &thread_run, (void *)thread); in thread_create()
213 static int thread_resume(thread_t *thread) in thread_resume() argument
215 sem_post(& thread->sem); in thread_resume()
225 thread_t *thread; in rt_hw_stack_init() local
227 thread = (thread_t *)(pStackAddr - sizeof(thread_t)); in rt_hw_stack_init()
230 memset(thread, 0x00, sizeof(thread_t)); in rt_hw_stack_init()
232 thread_create(thread, pEntry, pParam, pExit); in rt_hw_stack_init()
235 return (rt_uint8_t *) thread; in rt_hw_stack_init()