Bug fix for spsc-queue test
authorweiyu <weiyuluo1232@gmail.com>
Mon, 24 Aug 2020 22:45:26 +0000 (15:45 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Mon, 24 Aug 2020 22:45:26 +0000 (15:45 -0700)
model.cc

index 1e425b2ece627b877e5b33dd2d7bfde60d65b47e..ea8f268ff270fa8d59674570103699c1eb36eb03 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -346,13 +346,13 @@ uint64_t ModelChecker::switch_to_master(ModelAction *act)
 
 void ModelChecker::continueRunExecution(Thread *old) 
 {
-/*
+
        if (params.traceminsize != 0 &&
                        execution->get_curr_seq_num() > checkfree) {
                checkfree += params.checkthreshold;
                execution->collectActions();
        }
-*/
+
        thread_chosen = false;
        curr_thread_num = 1;
        Thread *thr = getNextThread();
@@ -368,13 +368,13 @@ void ModelChecker::continueRunExecution(Thread *old)
 
 void ModelChecker::startRunExecution(ucontext_t *old) 
 {
-/*
+
        if (params.traceminsize != 0 &&
                        execution->get_curr_seq_num() > checkfree) {
                checkfree += params.checkthreshold;
                execution->collectActions();
        }
-*/
+
        thread_chosen = false;
        curr_thread_num = 1;
        Thread *thr = getNextThread();
@@ -406,7 +406,7 @@ Thread* ModelChecker::getNextThread()
                        scheduler->sleep(thr);
                }
 
-//             chooseThread(act, thr);
+       chooseThread(act, thr);
        }
        return nextThread;
 }
@@ -491,7 +491,7 @@ uint64_t ModelChecker::switch_thread(ModelAction *act)
        if (act && execution->is_enabled(old) && !execution->check_action_enabled(act)) {
                scheduler->sleep(old);
        }
-//     chooseThread(act, old);
+       chooseThread(act, old);
 
        curr_thread_num++;
        Thread* next = getNextThread();
@@ -555,7 +555,7 @@ void ModelChecker::handleChosenThread(ucontext_t *old)
                finishRunExecution(old);
                return;
        }
-/*     if (chosen_thread->just_woken_up()) {
+       if (chosen_thread->just_woken_up()) {
                chosen_thread->set_wakeup_state(false);
                chosen_thread->set_pending(NULL);
                chosen_thread = NULL;
@@ -564,9 +564,7 @@ void ModelChecker::handleChosenThread(ucontext_t *old)
                        finishRunExecution(old);
                else
                        startRunExecution(old); 
-       } */
-
-       {
+       } else {
                /* Consume the next action for a Thread */
                consumeAction();