model: bugfix - reset the "current_action" after it has been processed
[model-checker.git] / threads.cc
index 47a211c20fe37ea25bf2536dc26cbbc520437291..917090fb71500665009e1c5d4d0e50d3de729e06 100644 (file)
@@ -121,11 +121,11 @@ static int thread_system_next(void)
        Thread *curr, *next;
 
        curr = thread_current();
-       model->check_current_action();
        if (curr) {
-               if (curr->get_state() == THREAD_READY)
+               if (curr->get_state() == THREAD_READY) {
+                       model->check_current_action();
                        model->scheduler->add_thread(curr);
-               else if (curr->get_state() == THREAD_RUNNING)
+               else if (curr->get_state() == THREAD_RUNNING)
                        /* Stopped while running; i.e., completed */
                        curr->complete();
                else