edits
authorroot <root@dw-6.eecs.uci.edu>
Mon, 29 Jul 2019 21:40:11 +0000 (14:40 -0700)
committerroot <root@dw-6.eecs.uci.edu>
Mon, 29 Jul 2019 21:40:11 +0000 (14:40 -0700)
action.cc
action.h
pthread.cc

index 72cf97246765403360275604d1076501e4a94bf7..f00a14313ed6a3af079c4b771f41ca1dd32c30e4 100644 (file)
--- 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";
index 7c79f435cff8aba9b248fba38af5ee40b8aac84c..d357066ad5850f2c61ac3115d4cebc1235658d04 100644 (file)
--- 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
index 120d365cf9d2e3354874c36453345a8f9d073753..0234cdaedb1abe17001df485c2099a813e437613 100644 (file)
@@ -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 *) {