From 7fe82d0f56f7b2791a06a29986902da142207a90 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 10 Apr 2012 15:08:23 -0700 Subject: [PATCH] libthreads: thread_join: return 'int' as status --- libthreads.cc | 3 ++- libthreads.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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); -- 2.34.1