more fixes
[c11tester.git] / pthread.cc
index 0234cdaedb1abe17001df485c2099a813e437613..efe1033b0c4dbb5b7d203dc6d53092c996e8d556 100644 (file)
@@ -57,6 +57,8 @@ void pthread_exit(void *value_ptr) {
        Thread * th = thread_current();
        th->set_pthread_return(value_ptr);
        model->switch_to_master(new ModelAction(THREADONLY_FINISH, std::memory_order_seq_cst, th));
+       //Need to exit so we don't return to the program
+       real_pthread_exit(NULL);
 }
 
 int pthread_mutex_init(pthread_mutex_t *p_mutex, const pthread_mutexattr_t *) {