libthreads: thread_join: return 'int' as status
authorBrian Norris <banorris@uci.edu>
Tue, 10 Apr 2012 22:08:23 +0000 (15:08 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 10 Apr 2012 22:08:23 +0000 (15:08 -0700)
libthreads.cc
libthreads.h

index fb828b18aa079e2d726d0cfc851600d7ec6d53d0..07ce633e5d29277881ef213563dc5e4c3b8350a9 100644 (file)
@@ -137,12 +137,13 @@ int thread_create(struct thread *t, void (*start_routine)(), void *arg)
        return 0;
 }
 
-void thread_join(struct thread *t)
+int thread_join(struct thread *t)
 {
        int ret = 0;
        while (t->state != THREAD_COMPLETED && !ret)
                /* seq_cst is just a 'don't care' parameter */
                ret = thread_switch_to_master(new ModelAction(THREAD_JOIN, memory_order_seq_cst, NULL, VALUE_NONE));
+       return ret;
 }
 
 int thread_yield(void)
index 9d290a7ddf12162ce67fa2a20294da4e4034cfb8..1ea54ea758ea895eeac0230082645fc1da9d7ce9 100644 (file)
@@ -22,7 +22,7 @@ struct thread {
 };
 
 int thread_create(struct thread *t, void (*start_routine)(), void *arg);
-void thread_join(struct thread *t);
+int thread_join(struct thread *t);
 int thread_yield(void);
 struct thread *thread_current(void);