Adding STL stuff and operator news of snapshot to model-checker. Need to actuallly...
[model-checker.git] / threads.h
index 7a21a30d8d93f49e4e0c13d37dfeb18f21260b47..b592804db95959445d5c4f967f449121e2d59bad 100644 (file)
--- a/threads.h
+++ b/threads.h
@@ -2,9 +2,11 @@
 #define __THREADS_H__
 
 #include <ucontext.h>
-
+#include "mymemory.h"
 #include "libthreads.h"
 
+typedef int thread_id_t;
+
 #define THREAD_ID_T_NONE       -1
 
 typedef enum thread_state {
@@ -16,8 +18,6 @@ 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();
        void complete();
@@ -29,8 +29,11 @@ public:
        void set_state(thread_state s) { state = s; }
        thread_id_t get_id();
        thrd_t get_thrd_t() { return *user_thread; }
+       Thread * get_parent() { return parent; }
+  MEMALLOC
 private:
        int create_context();
+       Thread *parent;
 
        void (*start_routine)();
        void *arg;