return create_context(t);
}
-static int thread_swap(struct thread *old, struct thread *new)
+static int thread_swap(struct thread *t1, struct thread *t2)
{
- return swapcontext(&old->context, &new->context);
+ return swapcontext(&t1->context, &t2->context);
}
static void thread_dispose(struct thread *t)
#include "model.h"
struct thread_list_node {
- struct thread *this;
+ struct thread *t;
struct thread_list_node *next;
int live;
};
printf("ran out of nodes\n");
exit(1);
}
- node->this = t;
+ node->t = t;
node->next = NULL;
node->live = 1;
if (!head)
return NULL;
- pop = head->this;
+ pop = head->t;
head->live = 0;
if (head == tail)
tail = NULL;