From e7e175a74d95b5ed0a50750453168275f2fa3589 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 16 Apr 2013 11:58:28 -0700 Subject: [PATCH] model: privatize ModelChecker::get_num_threads() The public interface is now in ModelExecution. --- model.cc | 2 +- model.h | 3 ++- nodestack.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/model.cc b/model.cc index 8e94561..0d79a39 100644 --- a/model.cc +++ b/model.cc @@ -444,7 +444,7 @@ void ModelChecker::run() * thread which just took a step--plus the first step * for any newly-created thread */ - for (unsigned int i = 0; i < execution->get_num_threads(); i++) { + for (unsigned int i = 0; i < get_num_threads(); i++) { thread_id_t tid = int_to_id(i); Thread *thr = get_thread(tid); if (!thr->is_model_thread() && !thr->is_complete() && !thr->get_pending()) { diff --git a/model.h b/model.h index 92592e5..77db6aa 100644 --- a/model.h +++ b/model.h @@ -60,7 +60,6 @@ public: bool is_enabled(Thread *t) const; bool is_enabled(thread_id_t tid) const; - unsigned int get_num_threads() const; Thread * get_current_thread() const; void switch_from_master(Thread *thread); @@ -83,6 +82,8 @@ private: int execution_number; + unsigned int get_num_threads() const; + void execute_sleep_set(); bool next_execution(); diff --git a/nodestack.cc b/nodestack.cc index bfcf11f..80bf5c4 100644 --- a/nodestack.cc +++ b/nodestack.cc @@ -803,7 +803,7 @@ ModelAction * NodeStack::explore_action(ModelAction *act, enabled_type_t *is_ena prevfairness = node_list[head_idx - model->params.fairwindow]; } - int next_threads = model->get_num_threads(); + int next_threads = execution->get_num_threads(); if (act->get_type() == THREAD_CREATE) next_threads++; node_list.push_back(new Node(act, head, next_threads, prevfairness)); -- 2.34.1