X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=promise.h;h=d729e0309868846425d0c439962187b7aa83de44;hb=88ccfdff63126a0fa70c094c7ed7e66f68e1b861;hp=180d9b01cc3bfc723d8dc3deb62c83c1a4e90e5a;hpb=5e4a7d161cba81152ddcf295ee72fbb25ba3afaa;p=c11tester.git diff --git a/promise.h b/promise.h index 180d9b01..d729e030 100644 --- a/promise.h +++ b/promise.h @@ -6,20 +6,23 @@ #ifndef __PROMISE_H__ #define __PROMISE_H__ -#include +#include class ModelAction; class Promise { public: - Promise(ModelAction * act, uint64_t value); - const 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() const { return value; } + private: - uint64_t value; - ModelAction *read; + const uint64_t value; + ModelAction * const read; unsigned int numthreads; };