fix code to be 64 bit clean
[c11tester.git] / threads.cc
index 10ff3c5d6b437fadcc4945f94102207e1d9cca5f..0ed7bdcabc084eabf0755c8df098b724d3c023c4 100644 (file)
@@ -1,7 +1,6 @@
-#include <stdlib.h>
+/* -*- Mode: C; indent-tabs-mode: t -*- */
 
 #include "libthreads.h"
-#include "schedule.h"
 #include "common.h"
 #include "threads.h"
 
@@ -25,6 +24,13 @@ Thread * thread_current(void)
        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;
@@ -39,7 +45,7 @@ int Thread::create_context()
        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;
 }
@@ -64,7 +70,6 @@ void Thread::complete()
        }
 }
 
-
 Thread::Thread(thrd_t *t, void (*func)(), void *a) {
        int ret;