- Promise(ModelAction *act, uint64_t value, modelclock_t expiration) :
- value(value), expiration(expiration), read(act), write(NULL)
- {
- increment_threads(act->get_tid());
- }
- modelclock_t get_expiration() const { return expiration; }
- ModelAction * get_action() const { return read; }
- bool increment_threads(thread_id_t tid);
-
- bool has_sync_thread(thread_id_t tid) {
- unsigned int id = id_to_int(tid);
- if (id >= synced_thread.size())
- return false;
- return synced_thread[id];
- }
-
- bool check_promise() const;
- uint64_t get_value() const { return value; }
+ Promise(const ModelExecution *execution, ModelAction *read, struct future_value fv);
+ bool add_reader(ModelAction *reader);
+ ModelAction * get_reader(unsigned int i) const;
+ unsigned int get_num_readers() const { return readers.size(); }
+ bool eliminate_thread(thread_id_t tid);
+ void add_thread(thread_id_t tid);
+ bool thread_is_available(thread_id_t tid) const;
+ bool has_failed() const;