scheduler->update_sleep_set(prevnode);
/* Reached divergence point */
- if (nextnode->increment_misc()) {
- /* The next node will try to satisfy a different misc_index values. */
- tid = next->get_tid();
- node_stack->pop_restofstack(2);
- } else if (nextnode->increment_promise()) {
- /* The next node will try to satisfy a different set of promises. */
- tid = next->get_tid();
- node_stack->pop_restofstack(2);
- } else if (nextnode->increment_read_from()) {
- /* The next node will read from a different value. */
- tid = next->get_tid();
- node_stack->pop_restofstack(2);
- } else if (nextnode->increment_relseq_break()) {
- /* The next node will try to resolve a release sequence differently */
+ if (nextnode->increment_behaviors()) {
+ /* Execute the same thread with a new behavior */
tid = next->get_tid();
node_stack->pop_restofstack(2);
} else {
/******************* end breaking release sequences ***************************/
+/**
+ * Increments some behavior's index, if a new behavior is available
+ * @return True if there is a new behavior available; otherwise false
+ */
+bool Node::increment_behaviors()
+{
+ /* satisfy a different misc_index values */
+ if (increment_misc())
+ return true;
+ /* satisfy a different set of promises */
+ if (increment_promise())
+ return true;
+ /* read from a different value */
+ if (increment_read_from())
+ return true;
+ /* resolve a release sequence differently */
+ if (increment_relseq_break())
+ return true;
+ return false;
+}
+
NodeStack::NodeStack() :
node_list(),
head_idx(-1),
bool increment_relseq_break();
bool relseq_break_empty() const;
+ bool increment_behaviors();
+
void print() const;
MEMALLOC