More bug fixes
[c11tester.git] / threads-model.h
index e2084abf5008e071bb4cd09e55b3d95a71b3a326..c6078200f5911f5bf3dd78f80125b881683e1a0e 100644 (file)
@@ -93,6 +93,9 @@ public:
         *  @see Thread::pending */
        void set_pending(ModelAction *act) { pending = act; }
 
+       bool just_woken_up() { return wakeup_state; }
+       void set_wakeup_state(bool state) { wakeup_state = state; }
+
        Thread * waiting_on() const;
        bool is_waiting_on(const Thread *t) const;
 
@@ -144,6 +147,9 @@ private:
         */
        ModelAction *pending;
 
+       /** @brief True if this thread was just woken up */
+       bool wakeup_state;
+
        void (*start_routine)(void *);
        void *(*pstart_routine)(void *);
 
@@ -151,6 +157,7 @@ private:
        ucontext_t context;
        void *stack;
 #ifdef TLS
+       void * helper_stack;
 public:
        char *tls;
        ucontext_t helpercontext;
@@ -179,11 +186,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)
 {