summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-10-26 00:07:03 -0400
committerTavian Barnes <tavianator@gmail.com>2009-10-26 00:07:03 -0400
commitb431153a3df2d5967357ab431940cf331b53ebc7 (patch)
tree51cc08fa2ef3f60b170de035b533b66c9a9d519c
parente9c25fd00ec34e0a7ca421b1ac230db157985f92 (diff)
downloaddimension-b431153a3df2d5967357ab431940cf331b53ebc7.tar.xz
Call dmnsn_done_progress() later in dmnsn_finish_progress().
-rw-r--r--libdimension/progress.c5
1 files 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);
}