X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=promise.h;h=11719fc3b2c291307f61e9480205265436ca7b48;hb=8497408d26002ec1a9d7cfd42458f92f2cdd9864;hp=7b3d1ecf363baf36e7cda4b2ae3d034a80ad61cf;hpb=bbf356ecc0554af1ecff878e305055ac1673d75e;p=model-checker.git diff --git a/promise.h b/promise.h index 7b3d1ec..11719fc 100644 --- a/promise.h +++ b/promise.h @@ -6,21 +6,26 @@ #ifndef __PROMISE_H__ #define __PROMISE_H__ -#include +#include class ModelAction; class Promise { public: - Promise(ModelAction * act, uint64_t value); - ModelAction * get_action() { return read; } + Promise(ModelAction *act, uint64_t value, modelclock_t expiration) : + value(value), expiration(expiration), read(act), numthreads(1) + { } + modelclock_t get_expiration() const {return expiration;} + ModelAction * get_action() const { return read; } int increment_threads() { return ++numthreads; } - uint64_t get_value() { return value; } - + uint64_t get_value() const { return value; } + + SNAPSHOTALLOC private: - uint64_t value; - ModelAction *read; + const uint64_t value; + const modelclock_t expiration; + ModelAction * const read; unsigned int numthreads; };