Small edits
authorweiyu <weiyuluo1232@gmail.com>
Wed, 2 Sep 2020 00:16:22 +0000 (17:16 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Wed, 2 Sep 2020 00:16:22 +0000 (17:16 -0700)
model.cc
model.h

index 4061fe0..5292b24 100644 (file)
--- 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 59ca728..7763c56 100644 (file)
--- 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);