3 * @brief Promise class --- tracks future obligations for execution
4 * related to weakly ordered writes.
13 #include "modeltypes.h"
20 modelclock_t expiration;
26 Promise(ModelAction *read, struct future_value fv);
27 modelclock_t get_expiration() const { return expiration; }
28 ModelAction * get_action() const { return read; }
29 bool eliminate_thread(thread_id_t tid);
30 void add_thread(thread_id_t tid);
31 bool thread_is_available(thread_id_t tid) const;
32 bool has_failed() const;
33 uint64_t get_value() const { return value; }
34 void set_write(const ModelAction *act) { write = act; }
35 const ModelAction * get_write() const { return write; }
36 int get_num_available_threads() const { return num_available_threads; }
37 bool is_compatible(const ModelAction *act) const;
38 bool is_compatible_exclusive(const ModelAction *act) const;
44 /** @brief Thread ID(s) for thread(s) that potentially can satisfy this
46 std::vector< bool, SnapshotAlloc<bool> > available_thread;
48 int num_available_threads;
51 const modelclock_t expiration;
53 /** @brief The action which reads a promised value */
54 ModelAction * const read;
56 const ModelAction *write;