From: Brian Norris Date: Tue, 10 Apr 2012 22:08:23 +0000 (-0700) Subject: libthreads: thread_join: return 'int' as status X-Git-Tag: pldi2013~562 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7fe82d0f56f7b2791a06a29986902da142207a90;p=model-checker.git libthreads: thread_join: return 'int' as status --- diff --git a/libthreads.cc b/libthreads.cc index fb828b1..07ce633 100644 --- a/libthreads.cc +++ b/libthreads.cc @@ -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) diff --git a/libthreads.h b/libthreads.h index 9d290a7..1ea54ea 100644 --- a/libthreads.h +++ b/libthreads.h @@ -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);