Implement timedwait
[c11tester.git] / model.cc
index 8f974762043065de618aea980d89ac2321ec9dcd..4b2143dc36ab4e303840059dd9ed1f7f22cd2c43 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -54,7 +54,14 @@ void install_handler() {
                perror("sigaction(SIGSEGV)");
                exit(EXIT_FAILURE);
        }
+}
 
+void createModelIfNotExist() {
+       if (!model) {
+               snapshot_system_init(100000);
+               model = new ModelChecker();
+               model->startChecker();
+       }
 }
 
 /** @brief Constructor */
@@ -378,7 +385,7 @@ Thread* ModelChecker::getNextThread(Thread *old)
                }
 
                ModelAction *act = thr->get_pending();
-               if (act && execution->is_enabled(tid)){
+               if (act && scheduler->is_enabled(tid)){
                        /* Don't schedule threads which should be disabled */
                        if (!execution->check_action_enabled(act)) {
                                scheduler->sleep(thr);