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 ModelAction * get_action() const { return read; }
28 bool eliminate_thread(thread_id_t tid);
29 void add_thread(thread_id_t tid);
30 bool thread_is_available(thread_id_t tid) const;
31 bool has_failed() const;
32 void set_write(const ModelAction *act) { write = act; }
33 const ModelAction * get_write() const { return write; }
34 int get_num_available_threads() const { return num_available_threads; }
35 bool is_compatible(const ModelAction *act) const;
36 bool is_compatible_exclusive(const ModelAction *act) const;
38 modelclock_t get_expiration() const { return fv.expiration; }
39 uint64_t get_value() const { return fv.value; }
40 struct future_value get_fv() const { return fv; }
46 /** @brief Thread ID(s) for thread(s) that potentially can satisfy this
48 std::vector< bool, SnapshotAlloc<bool> > available_thread;
50 int num_available_threads;
52 const future_value fv;
54 /** @brief The action which reads a promised value */
55 ModelAction * const read;
57 const ModelAction *write;