From b431153a3df2d5967357ab431940cf331b53ebc7 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 26 Oct 2009 00:07:03 -0400 Subject: Call dmnsn_done_progress() later in dmnsn_finish_progress(). --- libdimension/progress.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libdimension/progress.c b/libdimension/progress.c index bfeeff7..18c462f 100644 --- a/libdimension/progress.c +++ b/libdimension/progress.c @@ -136,9 +136,6 @@ int dmnsn_finish_progress(dmnsn_progress *progress) int retval = 1; if (progress) { - /* Wake up all waiters */ - dmnsn_done_progress(progress); - if (pthread_join(progress->thread, &ptr) != 0) { /* Medium severity because an unjoined thread likely means that the thread is incomplete or invalid */ @@ -146,6 +143,8 @@ int dmnsn_finish_progress(dmnsn_progress *progress) } else if (ptr) { retval = *(int *)ptr; free(ptr); + /* Wake up all waiters */ + dmnsn_done_progress(progress); } dmnsn_delete_progress(progress); } -- cgit v1.2.3