Experimental TLS support.
[c11tester.git] / threads-model.h
index 02f20b030778420d46a247e7a3980f34bf20396b..eebfcc7f820a114e5d24800a1ae60bc8da0b3199 100644 (file)
@@ -118,6 +118,9 @@ public:
        void operator delete[](void *p, size_t size) {
                Thread_free(p);
        }
+#ifdef TLS
+       void setTLS(char *_tls) { tls = _tls;}
+#endif
 private:
        int create_context();
 
@@ -142,6 +145,9 @@ private:
        void *arg;
        ucontext_t context;
        void *stack;
+#ifdef TLS
+       char *tls;
+#endif
        thrd_t *user_thread;
        thread_id_t id;
        thread_state state;
@@ -160,6 +166,10 @@ private:
        const bool model_thread;
 };
 
+#ifdef TLS
+uintptr_t get_tls_addr();
+#endif
+
 Thread * thread_current();
 void thread_startup();