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