projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
action: utilize release sequence(s) for synchronization
[c11tester.git]
/
promise.h
diff --git
a/promise.h
b/promise.h
index 180d9b01cc3bfc723d8dc3deb62c83c1a4e90e5a..d729e0309868846425d0c439962187b7aa83de44 100644
(file)
--- a/
promise.h
+++ b/
promise.h
@@
-6,20
+6,23
@@
#ifndef __PROMISE_H__
#define __PROMISE_H__
#ifndef __PROMISE_H__
#define __PROMISE_H__
-#include <inttypes.h>
+#include <inttypes.h>
class ModelAction;
class Promise {
public:
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; }
int increment_threads() { return ++numthreads; }
-
+ uint64_t get_value() const { return value; }
+
private:
private:
- uint64_t value;
- ModelAction *read;
+
const
uint64_t value;
+ ModelAction *
const
read;
unsigned int numthreads;
};
unsigned int numthreads;
};