#include "schedule.h"
#include "common.h"
+/* global "model" struct */
+#include "model.h"
+
#define STACK_SIZE (1024 * 1024)
static struct thread *current, *main_thread;
DBG();
old = current;
- schedule_add_thread(old);
- next = schedule_choose_next();
+ model->scheduler->add_thread(old);
+ next = model->scheduler->next_thread();
current = next;
DEBUG("(%d, %d)\n", old->index, next->index);
return thread_swap(old, next);
do {
if (current)
thread_dispose(current);
- next = schedule_choose_next();
+ next = model->scheduler->next_thread();
current = next;
} while (next && !thread_swap(main_thread, next));
}
if (ret)
return ret;
- schedule_add_thread(t);
+ model->scheduler->add_thread(t);
return 0;
}
{
struct thread user_thread;
+ model_checker_init();
+
main_thread = malloc(sizeof(struct thread));
create_initial_thread(main_thread);