projects
/
model-checker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b3b2aa7
)
action: refactor, move VALUE_TRY{SUCCESS,FAILED} out of header
author
Brian Norris
<banorris@uci.edu>
Thu, 11 Apr 2013 18:25:16 +0000
(11:25 -0700)
committer
Brian Norris
<banorris@uci.edu>
Thu, 11 Apr 2013 18:25:16 +0000
(11:25 -0700)
action.cc
patch
|
blob
|
history
action.h
patch
|
blob
|
history
diff --git
a/action.cc
b/action.cc
index 6e765fd638ac982ea22d47944983cab90452b815..08cacd89227f880c1bb391a83f799283c5de4e03 100644
(file)
--- a/
action.cc
+++ b/
action.cc
@@
-11,6
+11,12
@@
#define ACTION_INITIAL_CLOCK 0
#define ACTION_INITIAL_CLOCK 0
+/** A special value to represent a successful trylock */
+#define VALUE_TRYSUCCESS 1
+
+/** A special value to represent a failed trylock */
+#define VALUE_TRYFAILED 0
+
/**
* @brief Construct a new ModelAction
*
/**
* @brief Construct a new ModelAction
*
@@
-380,11
+386,9
@@
void ModelAction::create_cv(const ModelAction *parent)
cv = new ClockVector(NULL, this);
}
cv = new ClockVector(NULL, this);
}
-void ModelAction::set_try_lock(bool obtainedlock) {
- if (obtainedlock)
- value = VALUE_TRYSUCCESS;
- else
- value = VALUE_TRYFAILED;
+void ModelAction::set_try_lock(bool obtainedlock)
+{
+ value = obtainedlock ? VALUE_TRYSUCCESS : VALUE_TRYFAILED;
}
/**
}
/**
diff --git
a/action.h
b/action.h
index abf55318cd3ba379ea198420fad4ce70bfc570ea..46e8273e467ab3950bedd71adffbf46ce259860f 100644
(file)
--- a/
action.h
+++ b/
action.h
@@
-31,12
+31,6
@@
using std::memory_order_seq_cst;
* hence by iteself does not indicate no value. */
#define VALUE_NONE 0xdeadbeef
* hence by iteself does not indicate no value. */
#define VALUE_NONE 0xdeadbeef
-/** A special value to represent a successful trylock */
-#define VALUE_TRYSUCCESS 1
-
-/** A special value to represent a failed trylock */
-#define VALUE_TRYFAILED 0
-
/** @brief Represents an action type, identifying one of several types of
* ModelAction */
typedef enum action_type {
/** @brief Represents an action type, identifying one of several types of
* ModelAction */
typedef enum action_type {