Lines Matching refs:current_tid
57 static volatile int current_tid = MASTER_THREAD; variable
174 current_tid = MASTER_THREAD; in sched_init()
175 lthreads[current_tid].state = STATE_RUNNABLE; in sched_init()
177 (unsigned)lthreads[current_tid].context); in sched_init()
185 PDEBUG ("thread_yield: current tid=%d", current_tid); in thread_yield()
191 (unsigned)lthreads[current_tid].context); \ in thread_yield()
192 if(setjmp(lthreads[current_tid].context) == 0) { \ in thread_yield()
193 current_tid = new; \ in thread_yield()
204 for (i = current_tid + 1; i < MAX_THREADS; i++) { in thread_yield()
208 if (current_tid != 0) { in thread_yield()
209 for (i = 0; i <= current_tid; i++) { in thread_yield()
241 if (current_tid == id) in thread_delete()
251 (unsigned)lthreads[current_tid].func); in thread_launcher()
253 lthreads[current_tid].retval = in thread_launcher()
254 lthreads[current_tid].func (lthreads[current_tid].arg); in thread_launcher()
256 PDEBUG ("thread_launcher: tid %d terminated", current_tid); in thread_launcher()
258 lthreads[current_tid].state = STATE_TERMINATED; in thread_launcher()
275 if (setjmp (lthreads[current_tid].context) == 0) { in thread_start()
277 current_tid = id; in thread_start()
295 if (current_tid == id)