add switch thread function
[c11tester.git] / threads-model.h
index f2162a89e55752ffde61e74ebf3f0c675584d4ba..5756c1029688fb6fd9d29616291d496129592f7a 100644 (file)
@@ -49,6 +49,7 @@ public:
 
        static int swap(ucontext_t *ctxt, Thread *t);
        static int swap(Thread *t, ucontext_t *ctxt);
+       static int swap(Thread *t, Thread *t2);
 
        thread_state get_state() const { return state; }
        void set_state(thread_state s);
@@ -157,6 +158,7 @@ private:
        ucontext_t context;
        void *stack;
 #ifdef TLS
+       void * helper_stack;
 public:
        char *tls;
        ucontext_t helpercontext;
@@ -185,11 +187,12 @@ private:
 
 #ifdef TLS
 uintptr_t get_tls_addr();
+void tlsdestructor(void *v);
 #endif
 
 Thread * thread_current();
 void thread_startup();
-void main_thread_startup();
+void initMainThread();
 
 static inline thread_id_t thrd_to_id(thrd_t t)
 {