Get gdax to not crash
[c11tester.git] / pthread.cc
index f0f968489d4857c86f60b5ee13972d735fada982..808aa207cd72338806932b3afd86c2d5abe367c6 100644 (file)
@@ -44,18 +44,20 @@ int pthread_join(pthread_t t, void **value_ptr) {
 void pthread_exit(void *value_ptr) {
        Thread * th = thread_current();
        model->switch_to_master(new ModelAction(THREAD_FINISH, std::memory_order_seq_cst, th));
-       while(1) ;                      //make warning goaway
+       while(1) ;//make warning goaway
 }
 
 int pthread_mutex_init(pthread_mutex_t *p_mutex, const pthread_mutexattr_t *) {
+       cdsc::mutex *m = new cdsc::mutex();
+
        if (!model) {
+               snapshot_system_init(10000, 1024, 1024, 40000);
                model = new ModelChecker();
        }
 
-       cdsc::mutex *m = new cdsc::mutex();
-
        ModelExecution *execution = model->get_execution();
        execution->getMutexMap()->put(p_mutex, m);
+
        return 0;
 }