threads: prepare system to loop over many executions
[model-checker.git] / threads.cc
index 397c7894b70291b10016d1d3774ea74f7c840c73..830ea1a484159c9df61b641994781d30f97cb989 100644 (file)
@@ -3,7 +3,7 @@
 #include "libthreads.h"
 #include "schedule.h"
 #include "common.h"
-#include "threads_internal.h"
+#include "threads.h"
 
 /* global "model" object */
 #include "model.h"
@@ -138,13 +138,16 @@ int main()
 
        th = new Thread(&main_thread);
 
-       /* Start user program */
-       thrd_create(&user_thread, &user_main, NULL);
+       do {
+               /* Start user program */
+               thrd_create(&user_thread, &user_main, NULL);
 
-       /* Wait for all threads to complete */
-       thread_wait_finish();
+               /* Wait for all threads to complete */
+               thread_wait_finish();
+
+               model->print_trace();
+       } while (model->next_execution());
 
-       model->print_trace();
        delete th;
        delete model;