change the namespace of mutex from std to cdsc
[c11tester.git] / threads.cc
index 77b13c69be0a9fb75f555edf3caa13e974ea5466..d1929cd7ad5e6e3c3a781e813d8583a39e94e12d 100644 (file)
@@ -5,7 +5,7 @@
 #include <string.h>
 
 #include <threads.h>
-#include <mutex>
+#include "mutex.h"
 #include "common.h"
 #include "threads-model.h"
 #include "action.h"
@@ -54,7 +54,9 @@ void thread_startup()
        if (curr_thread->start_routine != NULL) {
                curr_thread->start_routine(curr_thread->arg);
        } else if (curr_thread->pstart_routine != NULL) {
-               curr_thread->pstart_routine(curr_thread->arg);
+               // set pthread return value
+               void *retval = curr_thread->pstart_routine(curr_thread->arg);
+               curr_thread->set_pthread_return(retval);
        }
        /* Finish thread properly */
        model->switch_to_master(new ModelAction(THREAD_FINISH, std::memory_order_seq_cst, curr_thread));