4 struct thread_list_node {
6 struct thread_list_node *next;
10 #define NUM_LIST_NODES 32
12 struct thread_list_node *head, *tail;
13 struct thread_list_node nodes[NUM_LIST_NODES];
15 static void enqueue_thread(struct thread *t)
18 struct thread_list_node *node;
20 for (node = nodes, i = 0; node->live && i < NUM_LIST_NODES; i++, node++);
21 if (i >= NUM_LIST_NODES)
22 printf("ran out of nodes\n");
34 static int dequeue_thread(struct thread **t)
48 void schedule_add_thread(struct thread *t)
50 DEBUG("thread %d\n", t->index);
54 int schedule_choose_next(struct thread **t)
56 return dequeue_thread(t);