projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d496f3f
)
promise: move constructor out of header
author
Brian Norris
<banorris@uci.edu>
Wed, 20 Feb 2013 07:29:42 +0000
(23:29 -0800)
committer
Brian Norris
<banorris@uci.edu>
Wed, 20 Feb 2013 07:29:42 +0000
(23:29 -0800)
promise.cc
patch
|
blob
|
history
promise.h
patch
|
blob
|
history
diff --git
a/promise.cc
b/promise.cc
index e38696ea4d119fd4d159656d3b3eed74443d8f3c..8519feef5e678726b1ea2369e48a35e0d95631bd 100644
(file)
--- a/
promise.cc
+++ b/
promise.cc
@@
-5,6
+5,22
@@
#include "model.h"
#include "schedule.h"
#include "model.h"
#include "schedule.h"
+/**
+ * @brief Promise constructor
+ * @param read The read which reads from a promised future value
+ * @param fv The future value that is promised
+ */
+Promise::Promise(ModelAction *read, struct future_value fv) :
+ num_available_threads(0),
+ value(fv.value),
+ expiration(fv.expiration),
+ read(read),
+ write(NULL)
+{
+ add_thread(fv.tid);
+ eliminate_thread(read->get_tid());
+}
+
/**
* Eliminate a thread which no longer can satisfy this promise. Once all
* enabled threads have been eliminated, this promise is unresolvable.
/**
* Eliminate a thread which no longer can satisfy this promise. Once all
* enabled threads have been eliminated, this promise is unresolvable.
diff --git
a/promise.h
b/promise.h
index 852fe714f896dfbffc0b409fcd499058841a1ee0..20aee036f99c3a6adad194b353846a524404ef1e 100644
(file)
--- a/
promise.h
+++ b/
promise.h
@@
-21,16
+21,7
@@
struct future_value {
class Promise {
public:
class Promise {
public:
- Promise(ModelAction *read, struct future_value fv) :
- num_available_threads(0),
- value(fv.value),
- expiration(fv.expiration),
- read(read),
- write(NULL)
- {
- add_thread(fv.tid);
- eliminate_thread(read->get_tid());
- }
+ Promise(ModelAction *read, struct future_value fv);
modelclock_t get_expiration() const { return expiration; }
ModelAction * get_action() const { return read; }
bool eliminate_thread(thread_id_t tid);
modelclock_t get_expiration() const { return expiration; }
ModelAction * get_action() const { return read; }
bool eliminate_thread(thread_id_t tid);