threads: save id within class Thread
[c11tester.git] / threads.h
index 8e0c3b054dfe7c84a92f60f0cc44ee700db00518..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,6 +33,7 @@ private:
        ucontext_t context;
        void *stack;
        thrd_t *user_thread;
+       thread_id_t id;
        thread_state state;
 };