thread_chosen = false;
curr_thread_num = 1;
-
Thread *thr = getNextThread(old);
if (thr != nullptr) {
scheduler->set_current_thread(thr);
_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)
{
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);
}
// 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);
void startRunExecution(Thread *old);
void finishRunExecution(Thread *old);
- void consumeAction();
void chooseThread(ModelAction *act, Thread *thr);
Thread * getNextThread(Thread *old);
bool handleChosenThread(Thread *old);