fix various problems with my 64-bit clean hack
[model-checker.git] / threads.h
index 345f42077a2372510d5922cd31d26420ed274cd7..57319067b4adb74255435cb721d723650900153c 100644 (file)
--- a/threads.h
+++ b/threads.h
@@ -2,7 +2,7 @@
 #define __THREADS_H__
 
 #include <ucontext.h>
-
+#include "mymemory.h"
 #include "libthreads.h"
 
 typedef int thread_id_t;
@@ -18,9 +18,7 @@ typedef enum thread_state {
 
 class Thread {
 public:
-       void * operator new(size_t size);
-       void operator delete(void *ptr);
-       Thread(thrd_t *t, void (*func)(), void *a);
+       Thread(thrd_t *t, void (*func)(void *), void *a);
        ~Thread();
        void complete();
 
@@ -32,11 +30,13 @@ public:
        thread_id_t get_id();
        thrd_t get_thrd_t() { return *user_thread; }
        Thread * get_parent() { return parent; }
+  friend void thread_startup();
+  MEMALLOC
 private:
        int create_context();
        Thread *parent;
 
-       void (*start_routine)();
+       void (*start_routine)(void *);
        void *arg;
        ucontext_t context;
        void *stack;