Make our pthread id starts from 2. Reserve id 1 for main thread
[c11tester.git] / model.cc
index 5b5ccf701c1798f9627c352f6ae50be4159fc929..f1df6ae8bfbbdacd806f56976de6b1c2f2bc8099 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -85,8 +85,6 @@ ModelChecker::ModelChecker() :
        parse_options(&params);
        initRaceDetector();
        /* Configure output redirection for the model-checker */
-       redirect_output();
-       install_trace_analyses(get_execution());
        install_handler();
 }
 
@@ -294,6 +292,7 @@ void ModelChecker::finish_execution(bool more_executions)
        execution_number ++;
        if (more_executions)
                reset_to_initial_state();
+
        history->set_new_exec_flag();
 }
 
@@ -384,6 +383,9 @@ static void runChecker() {
 void ModelChecker::startChecker() {
        startExecution(get_system_context(), runChecker);
        snapshot = take_snapshot();
+
+       install_trace_analyses(get_execution());
+       redirect_output();
        initMainThread();
 }