ichange
[model-checker.git] / action.cc
index 692d14cf03033d4b3c89ed7e05a7d386acdfe352..2d9186d2f812bdbbe0e7eab770e1e813b79386fe 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -27,6 +27,14 @@ ModelAction::~ModelAction()
                delete cv;
 }
 
+bool ModelAction::is_success_lock() const {
+       return type == ATOMIC_LOCK || (type == ATOMIC_TRYLOCK && value == VALUE_TRYSUCCESS);
+}
+
+bool ModelAction::is_failed_trylock() const {
+       return (type == ATOMIC_TRYLOCK && value == VALUE_TRYFAILED);
+}
+
 bool ModelAction::is_read() const
 {
        return type == ATOMIC_READ || type == ATOMIC_RMWR || type == ATOMIC_RMW;
@@ -52,6 +60,11 @@ bool ModelAction::is_rmwc() const
        return type == ATOMIC_RMWC;
 }
 
+bool ModelAction::is_fence() const 
+{
+       return type == ATOMIC_FENCE;
+}
+
 bool ModelAction::is_initialization() const
 {
        return type == ATOMIC_INIT;
@@ -168,7 +181,7 @@ void ModelAction::read_from(const ModelAction *act)
        ASSERT(cv);
        reads_from = act;
        if (act != NULL && this->is_acquire()) {
-               std::vector<const ModelAction *> release_heads;
+               std::vector< const ModelAction *, MyAlloc<const ModelAction *> > release_heads;
                model->get_release_seq_heads(this, &release_heads);
                for (unsigned int i = 0; i < release_heads.size(); i++)
                        synchronize_with(release_heads[i]);
@@ -218,6 +231,9 @@ void ModelAction::print(void) const
        case THREAD_JOIN:
                type_str = "thread join";
                break;
+       case THREAD_FINISH:
+               type_str = "thread finish";
+               break;
        case ATOMIC_READ:
                type_str = "atomic read";
                break;
@@ -227,6 +243,9 @@ void ModelAction::print(void) const
        case ATOMIC_RMW:
                type_str = "atomic rmw";
                break;
+       case ATOMIC_FENCE:
+               type_str = "fence";
+               break;
        case ATOMIC_RMWR:
                type_str = "atomic rmwr";
                break;