X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=threads-model.h;h=e77e80cc71de39663fd4078307c7c2220fee68a6;hp=fd0314ad6b9fa34ac5a42c0fd9cfd94f6f552753;hb=5ea8e3d5d861ed363e5ac5f3b20b8181dd197efb;hpb=09c3eb5539455e82dcb357fbce82bf5974c3a37c;ds=sidebyside diff --git a/threads-model.h b/threads-model.h index fd0314ad..e77e80cc 100644 --- a/threads-model.h +++ b/threads-model.h @@ -7,11 +7,11 @@ #include #include -#include #include "mymemory.h" #include #include "modeltypes.h" +#include "stl-model.h" struct thread_params { thrd_start_t func; @@ -41,7 +41,7 @@ class ModelAction; class Thread { public: Thread(thread_id_t tid); - Thread(thrd_t *t, void (*func)(void *), void *a); + 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; @@ -155,7 +157,7 @@ private: * list is used for thread joins, where another Thread waits for this * Thread to complete */ - std::vector< ModelAction *, SnapshotAlloc > wait_list; + SnapVector wait_list; /** * The value returned by the last action in this thread