X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=model.cc;h=cc035084b036015b94181ef7c61b17d2bbf77f65;hp=503253af17a5dc0ba4727b3dcff08d1dfcbf07d2;hb=6c69f716484f7a5acee72e0f02813fb98f4ac2ad;hpb=fcae856e66379752f8d227784d28c424206ab0c1 diff --git a/model.cc b/model.cc index 503253af..cc035084 100644 --- a/model.cc +++ b/model.cc @@ -327,11 +327,22 @@ void ModelChecker::set_bad_synchronization() priv->bad_synchronization = true; } +/** + * Check whether the current trace has triggered an assertion which should halt + * its execution. + * + * @return True, if the execution should be aborted; false otherwise + */ bool ModelChecker::has_asserted() const { return priv->asserted; } +/** + * Trigger a trace assertion which should cause this execution to be halted. + * This can be due to a detected bug or due to an infeasibility that should + * halt ASAP. + */ void ModelChecker::set_assert() { priv->asserted = true; @@ -2733,10 +2744,6 @@ Thread * ModelChecker::take_step(ModelAction *curr) return model_thread; } - /* next_thrd == NULL -> don't take any more steps */ - if (!next_thrd) - return NULL; - return next_thrd; } @@ -2755,6 +2762,12 @@ void ModelChecker::run() add_thread(t); do { + /* + * Stash next pending action(s) for thread(s). There + * should only need to stash one thread's action--the + * thread which just took a step--plus the first step + * for any newly-created thread + */ for (unsigned int i = 0; i < get_num_threads(); i++) { thread_id_t tid = int_to_id(i); Thread *thr = get_thread(tid);