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 ca4b28b..e1f74bf 100644 (file)
@@ -126,7 +126,8 @@ Thread::Thread(thrd_t *t, void (*func)(void *), void *a) :
        user_thread(t),
        state(THREAD_CREATED),
        wait_list(),
        user_thread(t),
        state(THREAD_CREATED),
        wait_list(),
-       last_action_val(VALUE_NONE)
+       last_action_val(VALUE_NONE),
+       model_thread(false)
 {
        int ret;
 
 {
        int ret;
 
index a379494..5e8cbef 100644 (file)
--- a/threads.h
+++ b/threads.h
@@ -101,6 +101,8 @@ public:
                return ret;
        }
 
                return ret;
        }
 
+       bool is_model_thread() { return model_thread; }
+
        friend void thread_startup();
 
        SNAPSHOTALLOC
        friend void thread_startup();
 
        SNAPSHOTALLOC
@@ -131,6 +133,9 @@ private:
         * @see Thread::get_return_value()
         */
        uint64_t last_action_val;
         * @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();
 };
 
 Thread * thread_current();