Get gdax to not crash
[c11tester.git] / pthread.cc
index 79e904257b38ef69973ce4733cb55ab3ed1ce527..808aa207cd72338806932b3afd86c2d5abe367c6 100644 (file)
@@ -49,16 +49,13 @@ void pthread_exit(void *value_ptr) {
 
 int pthread_mutex_init(pthread_mutex_t *p_mutex, const pthread_mutexattr_t *) {
        cdsc::mutex *m = new cdsc::mutex();
-       ModelExecution *execution;
 
        if (!model) {
-               if (!model_init) {
-                       snapshot_system_init(10000, 1024, 1024, 40000);
-                       model_init = new ModelChecker();
-               }
-               execution = model_init->get_execution();
-       } else
-               execution = model->get_execution();
+               snapshot_system_init(10000, 1024, 1024, 40000);
+               model = new ModelChecker();
+       }
+
+       ModelExecution *execution = model->get_execution();
        execution->getMutexMap()->put(p_mutex, m);
 
        return 0;