add support for pthread_mutex
[c11tester.git] / model.cc
index ccc109a7be96594f395c2ccd0f6ab56cf230a88f..39f0c694e9b7e440ee5ffa952ded7b4b06f0a7ca 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -503,8 +503,6 @@ void ModelChecker::run()
                                        scheduler->sleep(th);
                                }
                        }
-                       /* Catch assertions from prior take_step or from
-                        * between-ModelAction bugs (e.g., data races) */
 
                        for (unsigned int i = 1; i < get_num_threads(); i++) {
                                Thread *th = get_thread(int_to_id(i));
@@ -518,6 +516,7 @@ void ModelChecker::run()
                                                        break;
                                                }
                                        } else if (act->get_type() == THREAD_CREATE || \
+                                                       act->get_type() == PTHREAD_CREATE || \
                                                        act->get_type() == THREAD_START || \
                                                        act->get_type() == THREAD_FINISH) {
                                                t = th;
@@ -526,6 +525,8 @@ void ModelChecker::run()
                                }
                        }
 
+                       /* Catch assertions from prior take_step or from
+                        * between-ModelAction bugs (e.g., data races) */
 
                        if (execution->has_asserted())
                                break;
@@ -541,6 +542,8 @@ void ModelChecker::run()
                } while (!should_terminate_execution());
 
                has_next = next_execution();
+               pthread_map.clear();
+               mutex_map.clear();
                i++;
        } while (i<100); // while (has_next);