remove unnecessary #includes
[model-checker.git] / model.cc
index 858b9198bccc2fea775d3870970c9f4a0e19ef7e..b97352a97f15baebbf2c0ff578bab195a444928c 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -1,7 +1,5 @@
 #include "model.h"
 #include "schedule.h"
-#include <stdlib.h>
-#include <string.h>
 
 ModelChecker *model;
 
@@ -9,17 +7,13 @@ ModelChecker::ModelChecker()
 {
        /* First thread created (system_thread) will have id 1 */
        this->used_thread_id = 0;
-
-       scheduler_init(this);
+       /* Initialize default scheduler */
+       this->scheduler = new DefaultScheduler();
 }
 
 ModelChecker::~ModelChecker()
 {
-       struct scheduler *sched = model->scheduler;
-
-       if (sched->exit)
-               sched->exit();
-       free(sched);
+       delete this->scheduler;
 }
 
 void ModelChecker::assign_id(struct thread *t)
@@ -29,5 +23,5 @@ void ModelChecker::assign_id(struct thread *t)
 
 void ModelChecker::add_system_thread(struct thread *t)
 {
-       model->system_thread = t;
+       this->system_thread = t;
 }