I changed a line previously and didn't even notice that I wasn't
matching the comment anymore! Of course, the comment was correct, and my
code was wrong.
Promise *promise = (*promises)[i];
// Is this promise on the same location?
- if (promise->get_value() != write->get_value())
+ if (!promise->same_location(write))
continue;
for (unsigned int j = 0; j < promise->get_num_readers(); j++) {
{
return get_num_available_threads() == 1 && is_compatible(act);
}
+
+/**
+ * @brief Check if a ModelAction's location matches this Promise
+ * @param act The ModelAction to check
+ * @return True if the action's location matches this Promise
+ */
+bool Promise::same_location(const ModelAction *act) const
+{
+ return get_reader(0)->same_var(act);
+}
int get_num_available_threads() const { return num_available_threads; }
bool is_compatible(const ModelAction *act) const;
bool is_compatible_exclusive(const ModelAction *act) const;
+ bool same_location(const ModelAction *act) const;
modelclock_t get_expiration() const { return fv.expiration; }
uint64_t get_value() const { return fv.value; }