threads: save id within class Thread
[model-checker.git] / threads.h
index 9787c3fb9514fdf4eee5c84503f1aedcb0e2ad31..0c5fdab9d7a2209d4fda10680b0f737b03c657f2 100644 (file)
--- a/threads.h
+++ b/threads.h
@@ -24,7 +24,6 @@ public:
        thread_state get_state() { return state; }
        void set_state(thread_state s) { state = s; }
        thread_id_t get_id();
-       void set_id(thread_id_t i) { *user_thread = i; }
        thrd_t get_thrd_t() { return *user_thread; }
 private:
        int create_context();
@@ -34,10 +33,11 @@ private:
        ucontext_t context;
        void *stack;
        thrd_t *user_thread;
+       thread_id_t id;
        thread_state state;
 };
 
-Thread *thread_current();
+Thread * thread_current();
 
 static inline thread_id_t thrd_to_id(thrd_t t)
 {