Merge remote 'yield' work
[c11tester.git] / threads-model.h
index 30acd2deba1f50e27a15d1c2d74a649809cf004a..b15c40944aedadb3114d1239d1f16b6259e51535 100644 (file)
@@ -41,7 +41,7 @@ class ModelAction;
 class Thread {
 public:
        Thread(thread_id_t tid);
-       Thread(thrd_t *t, void (*func)(void *), void *a, Thread * parent_thrd = NULL);
+       Thread(thrd_t *t, void (*func)(void *), void *a, Thread *parent);
        ~Thread();
        void complete();
 
@@ -104,6 +104,8 @@ public:
         *  @see Thread::pending */
        void set_pending(ModelAction *act) { pending = act; }
 
+       Thread * waiting_on() const;
+
        /**
         * Remove one ModelAction from the waiting list
         * @return The ModelAction that was removed from the waiting list
@@ -128,7 +130,7 @@ private:
        int create_context();
 
        /** @brief The parent Thread which created this Thread */
-       Thread *parent;
+       Thread * const parent;
 
        /** @brief The THREAD_CREATE ModelAction which created this Thread */
        ModelAction *creation;