X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=promise.h;h=d729e0309868846425d0c439962187b7aa83de44;hb=f001f8b98c907df8bd7f38e92c00445071f26304;hp=fda00cc508229221e5965ea3c752443d503bb1ca;hpb=fec9254c3747d5dde5d45e1ef81f7261c74bd5a7;p=model-checker.git diff --git a/promise.h b/promise.h index fda00cc..d729e03 100644 --- a/promise.h +++ b/promise.h @@ -6,21 +6,23 @@ #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) : + value(value), read(act), numthreads(1) + { } + ModelAction * get_action() const { return read; } int increment_threads() { return ++numthreads; } - uint64_t get_value() { return value; } + uint64_t get_value() const { return value; } private: - uint64_t value; - ModelAction *read; + const uint64_t value; + ModelAction * const read; unsigned int numthreads; };