fix mutex_trylock bug
[c11tester.git] / actionlist.cc
index 9f95384d1ac487d94906b99612a69c7e8eb8ba65..f97e667a00c9a20273bbd7e146b4543d96776eda 100644 (file)
@@ -227,8 +227,7 @@ void actionlist::removeAction(ModelAction * act) {
 void actionlist::clear() {
        for(uint i = 0;i < ALLNODESIZE;i++) {
                if (root.children[i] != NULL) {
-                       if (!(((uintptr_t) root.children[i]) & ISACT))
-                               delete root.children[i];
+                       delete root.children[i];
                        root.children[i] = NULL;
                }
        }
@@ -247,3 +246,16 @@ void actionlist::clear() {
 bool actionlist::isEmpty() {
        return root.count == 0;
 }
+
+/**
+ * Fix the parent pointer of root when root address changes (possible
+ * due to vector<action_list_t> resize)
+ */
+void actionlist::fixupParent()
+{
+       for (int i = 0;i < ALLNODESIZE;i++) {
+               allnode * child = root.children[i];
+               if (child != NULL && child->parent != &root)
+                       child->parent = &root;
+       }
+}