3 struct thread_list_node {
5 struct thread_list_node *next;
9 #define NUM_LIST_NODES 32
11 struct thread_list_node *head, *tail;
12 struct thread_list_node nodes[NUM_LIST_NODES];
14 static void enqueue_thread(struct thread *t)
17 struct thread_list_node *node;
19 for (node = nodes, i = 0; node->live && i < NUM_LIST_NODES; i++, node++);
20 if (i >= NUM_LIST_NODES)
21 printf("ran out of nodes\n");
33 static int dequeue_thread(struct thread **t)
47 void schedule_add_thread(struct thread *t)
49 DEBUG("thread %d\n", t->index);
53 int schedule_choose_next(struct thread **t)
55 return dequeue_thread(t);