Lines Matching refs:i

87 	int i, j;  in sched()  local
95 for (i = 0; i < NUMTHREADS; i++) { in sched()
96 names[i] = i; in sched()
97 j = thread_create (testthread, (void *) &names[i]); in sched()
99 printf ("schedtest: Failed to create thread %d\n", i); in sched()
102 j, i); in sched()
103 tid[i] = j; in sched()
109 for (i = 0; i < NUMTHREADS; i++) { in sched()
110 printf ("schedtest: Setting thread %d runnable\n", tid[i]); in sched()
111 thread_start (tid[i]); in sched()
120 for (i = 0; i < NUMTHREADS; i++) { in sched()
121 printf ("schedtest: Deleting thread %d\n", tid[i]); in sched()
122 thread_delete (tid[i]); in sched()
127 i = thread_join (&j); in sched()
128 if (i == RC_FAILURE) { in sched()
133 printf ("schedtest: thread is %d returned %d\n", i, j); in sched()
142 int i; in testthread() local
145 *(int *) name, (unsigned)&i); in testthread()
147 printf ("Thread %02d, i=%d\n", *(int *) name, i); in testthread()
149 for (i = 0; i < 0xffff * (*(int *) name + 1); i++) { in testthread()
156 if (i % 100 == 0) in testthread()
161 *(int *) name + 1, i); in testthread()
169 int i; in sched_init() local
171 for (i = MASTER_THREAD + 1; i < MAX_THREADS; i++) in sched_init()
172 lthreads[i].state = STATE_EMPTY; in sched_init()
183 static int i; in thread_yield() local
204 for (i = current_tid + 1; i < MAX_THREADS; i++) { in thread_yield()
205 SWITCH (i); in thread_yield()
209 for (i = 0; i <= current_tid; i++) { in thread_yield()
210 SWITCH (i); in thread_yield()
220 int i; in thread_create() local
222 for (i = MASTER_THREAD + 1; i < MAX_THREADS; i++) { in thread_create()
223 if (lthreads[i].state == STATE_EMPTY) { in thread_create()
224 lthreads[i].state = STATE_STOPPED; in thread_create()
225 lthreads[i].func = func; in thread_create()
226 lthreads[i].arg = arg; in thread_create()
227 PDEBUG ("thread_create: returns new tid %d", i); in thread_create()
228 return i; in thread_create()
305 int i, j = 0; in thread_join() local
319 for (i = MASTER_THREAD + 1; i < MAX_THREADS; i++) { in thread_join()
320 if (lthreads[i].state == STATE_TERMINATED) { in thread_join()
321 *ret = lthreads[i].retval; in thread_join()
322 lthreads[i].state = STATE_EMPTY; in thread_join()
328 if (lthreads[i].state != STATE_EMPTY) { in thread_join()
330 j, i, lthreads[i].state); in thread_join()
345 i = *ret; in thread_join()
348 PDEBUG ("thread_join: returing %d for tid %d", *ret, i); in thread_join()