Do not allow a thread to stash the next pending action if its last action was a SLEEP...
[c11tester.git] / execution.cc
index e285156fd15d1526d2492006354fd7527535df06..e7ca575d8165f01ac30393027de18e5b9b01e1e2 100644 (file)
@@ -161,6 +161,7 @@ bool ModelExecution::should_wake_up(const ModelAction *curr, const Thread *threa
                if (fence_release && *(get_last_action(thread->get_id())) < *fence_release)
                        return true;
        }
+       /* The sleep is literally sleeping */
        if (asleep->is_sleep()) {
                if (fuzzer->shouldWake(asleep))
                        return true;
@@ -178,7 +179,7 @@ void ModelExecution::wake_up_sleeping_actions(ModelAction *curr)
                                /* Remove this thread from sleep set */
                                scheduler->remove_sleep(thr);
                                if (thr->get_pending()->is_sleep())
-                                       thr->set_pending(NULL);
+                                       thr->set_wakeup_state(true);
                        }
                }
        }
@@ -821,12 +822,14 @@ ModelAction * ModelExecution::process_rmw(ModelAction *act) {
  *
  * @param curr The current action. Must be a read.
  * @param rf The ModelAction or Promise that curr reads from. Must be a write.
- * @param check_only Only check if the current action satisfies read 
- *        modification order or not, without modifiying priorsetand canprune
+ * @param check_only If true, then only check whether the current action satisfies
+ *        read modification order or not, without modifiying priorset and canprune.
+ *        False by default.
  * @return True if modification order edges were added; false otherwise
  */
 
-bool ModelExecution::r_modification_order(ModelAction *curr, const ModelAction *rf, SnapVector<const ModelAction *> * priorset, bool * canprune, bool check_only)
+bool ModelExecution::r_modification_order(ModelAction *curr, const ModelAction *rf,
+       SnapVector<const ModelAction *> * priorset, bool * canprune, bool check_only)
 {
        SnapVector<action_list_t> *thrd_lists = obj_thrd_map.get(curr->get_location());
        unsigned int i;