threads: add flag for a special type of "model-checker thread"
authorBrian Norris <banorris@uci.edu>
Sat, 6 Oct 2012 00:42:03 +0000 (17:42 -0700)
committerBrian Norris <banorris@uci.edu>
Mon, 8 Oct 2012 05:22:52 +0000 (22:22 -0700)
Special model-checker thread(s) might be needed when producing special
model-checker ModelActions.

threads.cc
threads.h

index ca4b28b1bc850c9ea5bcab709e2d27a9e74e2581..e1f74bfbd210da803259b09300ca15f5db3f964e 100644 (file)
@@ -126,7 +126,8 @@ Thread::Thread(thrd_t *t, void (*func)(void *), void *a) :
        user_thread(t),
        state(THREAD_CREATED),
        wait_list(),
-       last_action_val(VALUE_NONE)
+       last_action_val(VALUE_NONE),
+       model_thread(false)
 {
        int ret;
 
index a379494d43bd93ee78dea0f3f0bb98dcd0af60a4..5e8cbef50a95648f2b6ac35069620b44b4e433a8 100644 (file)
--- a/threads.h
+++ b/threads.h
@@ -101,6 +101,8 @@ public:
                return ret;
        }
 
+       bool is_model_thread() { return model_thread; }
+
        friend void thread_startup();
 
        SNAPSHOTALLOC
@@ -131,6 +133,9 @@ private:
         * @see Thread::get_return_value()
         */
        uint64_t last_action_val;
+
+       /** @brief Is this Thread a special model-checker thread? */
+       const bool model_thread;
 };
 
 Thread * thread_current();