From 7708d1c8c64e110afca33c21355c665a57a6d8c9 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 2 May 2012 15:54:40 -0700 Subject: [PATCH] model: number threads from 0, not 1 --- model.cc | 8 ++++---- model.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/model.cc b/model.cc index c3452b0..c829312 100644 --- a/model.cc +++ b/model.cc @@ -12,8 +12,8 @@ ModelChecker *model; ModelChecker::ModelChecker() { - /* First thread created will have id (INITIAL_THREAD_ID + 1) */ - this->used_thread_id = INITIAL_THREAD_ID; + /* First thread created will have id INITIAL_THREAD_ID */ + this->next_thread_id = INITIAL_THREAD_ID; used_sequence_numbers = 0; /* Initialize default scheduler */ this->scheduler = new Scheduler(); @@ -45,14 +45,14 @@ void ModelChecker::reset_to_initial_state() action_trace = new action_list_t(); currentNode = rootNode; current_action = NULL; - used_thread_id = INITIAL_THREAD_ID; + next_thread_id = INITIAL_THREAD_ID; used_sequence_numbers = 0; /* scheduler reset ? */ } thread_id_t ModelChecker::get_next_id() { - return ++used_thread_id; + return next_thread_id++; } int ModelChecker::get_next_seq_num() diff --git a/model.h b/model.h index ebb9211..033bde2 100644 --- a/model.h +++ b/model.h @@ -60,7 +60,7 @@ public: bool next_execution(); private: - int used_thread_id; + int next_thread_id; int used_sequence_numbers; int num_executions; -- 2.34.1