From: root Date: Mon, 29 Jul 2019 21:40:11 +0000 (-0700) Subject: edits X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=1a2e39876cbd4a779e7c387a57ba1d26740e9c6a edits --- diff --git a/action.cc b/action.cc index 72cf9724..f00a1431 100644 --- a/action.cc +++ b/action.cc @@ -645,6 +645,7 @@ const char * ModelAction::get_type_str() const case THREAD_YIELD: return "thread yield"; case THREAD_JOIN: return "thread join"; case THREAD_FINISH: return "thread finish"; + case THREADONLY_FINISH: return "pthread_exit finish"; case PTHREAD_CREATE: return "pthread create"; case PTHREAD_JOIN: return "pthread join"; diff --git a/action.h b/action.h index 7c79f435..d357066a 100644 --- a/action.h +++ b/action.h @@ -52,6 +52,7 @@ typedef enum action_type { THREAD_YIELD, // < A thread yield action THREAD_JOIN, // < A thread join action THREAD_FINISH, // < A thread completion action + THREADONLY_FINISH, // < A thread completion action PTHREAD_CREATE, // < A pthread creation action PTHREAD_JOIN, // < A pthread join action ATOMIC_UNINIT, // < Represents an uninitialized atomic diff --git a/pthread.cc b/pthread.cc index 120d365c..0234cdae 100644 --- a/pthread.cc +++ b/pthread.cc @@ -55,8 +55,8 @@ int pthread_detach(pthread_t t) { 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 + th->set_pthread_return(value_ptr); + model->switch_to_master(new ModelAction(THREADONLY_FINISH, std::memory_order_seq_cst, th)); } int pthread_mutex_init(pthread_mutex_t *p_mutex, const pthread_mutexattr_t *) {