From 4f75769ad58872159aeaa4d96198080a7d6a4908 Mon Sep 17 00:00:00 2001 From: Derek Yeh Date: Thu, 30 Jul 2020 17:04:48 -0700 Subject: [PATCH] fix thread switch --- model.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/model.cc b/model.cc index 1c411bd6..53bb7b0d 100644 --- a/model.cc +++ b/model.cc @@ -351,8 +351,8 @@ void ModelChecker::continueExecution(Thread *old) checkfree += params.checkthreshold; execution->collectActions(); } - curr_thread_num = 0; - thread_id_t tid = int_to_id(0); + curr_thread_num = 1; + thread_id_t tid = int_to_id(1); Thread *thr = get_thread(tid); scheduler->set_current_thread(thr); if (Thread::swap(old, thr) < 0) { @@ -404,7 +404,7 @@ uint64_t ModelChecker::switch_thread(ModelAction *act) while (curr_thread_num < get_num_threads()) { thread_id_t tid = int_to_id(curr_thread_num); next = get_thread(tid); - if (!next->is_model_thread() && !next->is_complete() && !next->get_pending()) + if (!next->is_complete() && !next->get_pending()) break; curr_thread_num++; } @@ -504,8 +504,8 @@ void ModelChecker::run() for(int exec = 0;exec < params.maxexecutions;exec++) { chosen_thread = init_thread; thread_chosen = false; - curr_thread_num = 0; - thread_id_t tid = int_to_id(0); + curr_thread_num = 1; + thread_id_t tid = int_to_id(1); Thread *thr = get_thread(tid); switch_from_master(thr); finish_execution((exec+1) < params.maxexecutions); -- 2.34.1