if (mo_graph->checkForCycles())
return false;
- while (rf) {
+ for ( ; rf != NULL; rf = rf->get_reads_from()) {
ASSERT(rf->is_write());
if (rf->is_release())
/* acq_rel RMW is a sufficient stopping condition */
if (rf->is_acquire() && rf->is_release())
return true; /* complete */
-
- rf = rf->get_reads_from();
};
if (!rf) {
/* read from future: need to settle this later */
bool ModelChecker::sleep_can_read_from(ModelAction *curr, const ModelAction *write)
{
- while (true) {
+ for ( ; write != NULL; write = write->get_reads_from()) {
/* UNINIT actions don't have a Node, and they never sleep */
if (write->is_uninitialized())
return true;
bool thread_sleep = prevnode->enabled_status(curr->get_tid()) == THREAD_SLEEP_SET;
if (write->is_release() && thread_sleep)
return true;
- if (!write->is_rmw()) {
+ if (!write->is_rmw())
return false;
- }
- if (write->get_reads_from() == NULL)
- return true;
- write = write->get_reads_from();
}
+ return true;
}
/**