X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=action.cc;fp=action.cc;h=08cacd89227f880c1bb391a83f799283c5de4e03;hb=f5305a99cba598d0de55358df103439831dd1eb2;hp=6e765fd638ac982ea22d47944983cab90452b815;hpb=b3b2aa79d695bcef7f7f862aca7d1dffa334b3b8;p=model-checker.git diff --git a/action.cc b/action.cc index 6e765fd..08cacd8 100644 --- a/action.cc +++ b/action.cc @@ -11,6 +11,12 @@ #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 * @@ -380,11 +386,9 @@ void ModelAction::create_cv(const ModelAction *parent) 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; } /**