From 0696cb09629cd168f122a2e134246d79c3c8fd2c Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 5 Oct 2012 17:42:03 -0700 Subject: [PATCH] threads: add flag for a special type of "model-checker thread" Special model-checker thread(s) might be needed when producing special model-checker ModelActions. --- threads.cc | 3 ++- threads.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/threads.cc b/threads.cc index ca4b28b1..e1f74bfb 100644 --- a/threads.cc +++ b/threads.cc @@ -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; diff --git a/threads.h b/threads.h index a379494d..5e8cbef5 100644 --- 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(); -- 2.34.1