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 increment_threads(act->get_tid());
31 modelclock_t get_expiration() const { return expiration; }
32 ModelAction * get_action() const { return read; }
33 bool increment_threads(thread_id_t tid);
35 bool has_sync_thread(thread_id_t tid) {
36 unsigned int id = id_to_int(tid);
37 if (id >= synced_thread.size())
39 return synced_thread[id];
42 bool check_promise() const;
43 uint64_t get_value() const { return value; }
44 void set_write(const ModelAction *act) { write = act; }
45 const ModelAction * get_write() { return write; }
49 std::vector<bool> synced_thread;
51 const modelclock_t expiration;
52 ModelAction * const read;
53 const ModelAction *write;