From: weiyu Date: Wed, 2 Sep 2020 00:16:22 +0000 (-0700) Subject: Small edits X-Git-Url: http://demsky.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=193c917736aedbc4b34e6cae3e6eb35eb5e98502 Small edits --- diff --git a/model.cc b/model.cc index 4061fe0c..5292b247 100644 --- a/model.cc +++ b/model.cc @@ -332,7 +332,6 @@ void ModelChecker::startRunExecution(Thread *old) { thread_chosen = false; curr_thread_num = 1; - Thread *thr = getNextThread(old); if (thr != nullptr) { scheduler->set_current_thread(thr); @@ -406,13 +405,6 @@ void ModelChecker::finishRunExecution(Thread *old) _Exit(0); } -void ModelChecker::consumeAction() -{ - ModelAction *curr = chosen_thread->get_pending(); - chosen_thread->set_pending(NULL); - chosen_thread = execution->take_step(curr); -} - /* Allow pending relaxed/release stores or thread actions to perform first */ void ModelChecker::chooseThread(ModelAction *act, Thread *thr) { @@ -461,10 +453,6 @@ uint64_t ModelChecker::switch_thread(ModelAction *act) if (old->is_waiting_on(old)) assert_bug("Deadlock detected (thread %u)", curr_thread_num); - if (act && execution->is_enabled(old) && !execution->check_action_enabled(act)) { - scheduler->sleep(old); - } - Thread* next = getNextThread(old); if (next != nullptr) { scheduler->set_current_thread(next); @@ -502,7 +490,9 @@ bool ModelChecker::handleChosenThread(Thread *old) } // Consume the next action for a Thread - consumeAction(); + ModelAction *curr = chosen_thread->get_pending(); + chosen_thread->set_pending(NULL); + chosen_thread = execution->take_step(curr); if (should_terminate_execution()) { finishRunExecution(old); diff --git a/model.h b/model.h index 59ca7283..7763c568 100644 --- a/model.h +++ b/model.h @@ -77,7 +77,6 @@ private: void startRunExecution(Thread *old); void finishRunExecution(Thread *old); - void consumeAction(); void chooseThread(ModelAction *act, Thread *thr); Thread * getNextThread(Thread *old); bool handleChosenThread(Thread *old);