3 * @brief Promise class --- tracks future obligations for execution
4 * related to weakly ordered writes.
11 #include "threads-model.h"
14 #include "modeltypes.h"
18 modelclock_t expiration;
23 Promise(ModelAction *act, struct future_value fv) :
25 expiration(fv.expiration),
29 eliminate_thread(act->get_tid());
31 modelclock_t get_expiration() const { return expiration; }
32 ModelAction * get_action() const { return read; }
33 bool eliminate_thread(thread_id_t tid);
34 bool thread_is_eliminated(thread_id_t tid) const;
35 bool has_failed() const;
36 uint64_t get_value() const { return value; }
37 void set_write(const ModelAction *act) { write = act; }
38 const ModelAction * get_write() { return write; }
42 std::vector< bool, SnapshotAlloc<bool> > eliminated_thread;
44 const modelclock_t expiration;
45 ModelAction * const read;
46 const ModelAction *write;