+/* -*- Mode: C; indent-tabs-mode: t -*- */
+
#include "libthreads.h"
#include "common.h"
#include "threads.h"
return model->scheduler->get_current_thread();
}
+/* This method just gets around makecontext not being 64-bit clean */
+
+void thread_startup() {
+ Thread * curr_thread=thread_current();
+ curr_thread->start_routine(curr_thread->arg);
+}
+
int Thread::create_context()
{
int ret;
context.uc_stack.ss_size = STACK_SIZE;
context.uc_stack.ss_flags = 0;
context.uc_link = model->get_system_context();
- makecontext(&context, start_routine, 1, arg);
+ makecontext(&context, start_routine, 1);
return 0;
}
}
}
-
Thread::Thread(thrd_t *t, void (*func)(), void *a) {
int ret;