projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model/threads: add documentation comments
[model-checker.git]
/
model.cc
diff --git
a/model.cc
b/model.cc
index 503253af17a5dc0ba4727b3dcff08d1dfcbf07d2..856a33d2cdfa13d2db741797d4fc0f1681a9fd04 100644
(file)
--- a/
model.cc
+++ b/
model.cc
@@
-327,11
+327,22
@@
void ModelChecker::set_bad_synchronization()
priv->bad_synchronization = true;
}
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;
}
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;
void ModelChecker::set_assert()
{
priv->asserted = true;
@@
-2755,6
+2766,12
@@
void ModelChecker::run()
add_thread(t);
do {
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);
for (unsigned int i = 0; i < get_num_threads(); i++) {
thread_id_t tid = int_to_id(i);
Thread *thr = get_thread(tid);