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";
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
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 *) {