#include "stl-model.h"
class ModelAction;
+class ModelExecution;
struct future_value {
uint64_t value;
class Promise {
public:
- Promise(ModelAction *read, struct future_value fv);
+ 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;
+ unsigned int max_available_thread_idx() const;
bool has_failed() const;
void set_write(const ModelAction *act) { write = act; }
const ModelAction * get_write() const { return write; }
SNAPSHOTALLOC
private:
+ /** @brief The execution which created this Promise */
+ const ModelExecution *execution;
+
/** @brief Thread ID(s) for thread(s) that potentially can satisfy this
* promise */
SnapVector<bool> available_thread;