summaryrefslogtreecommitdiffstats
path: root/libdimension/progress.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-07-08 17:12:02 +0000
committerTavian Barnes <tavianator@gmail.com>2009-07-08 17:12:02 +0000
commitbff7f2b3b440c30d0d6eb692576af57ef42edd1b (patch)
tree0ba45051db1ee7b7808339cfb587f8f76d8c7c5c /libdimension/progress.c
parent14c9cd86e1b7c6ff27c5000d72721c54a718daac (diff)
downloaddimension-bff7f2b3b440c30d0d6eb692576af57ef42edd1b.tar.xz
Comments and style adjustments, and a couple fixes.
Diffstat (limited to 'libdimension/progress.c')
-rw-r--r--libdimension/progress.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libdimension/progress.c b/libdimension/progress.c
index f366832..24f3a5e 100644
--- a/libdimension/progress.c
+++ b/libdimension/progress.c
@@ -63,6 +63,8 @@ dmnsn_new_progress()
return NULL;
}
+ /* Initialize the rwlock, condition variable, and mutex */
+
if (pthread_rwlock_init(progress->rwlock, NULL) != 0) {
free(progress->rwlock);
free(progress->mutex);
@@ -71,7 +73,6 @@ dmnsn_new_progress()
free(progress);
return NULL;
}
-
if (pthread_cond_init(progress->cond, NULL) != 0) {
if (pthread_rwlock_destroy(progress->rwlock) != 0) {
dmnsn_error(DMNSN_SEVERITY_LOW,
@@ -135,9 +136,8 @@ int dmnsn_finish_progress(dmnsn_progress *progress)
int retval = 1;
if (progress) {
- if (pthread_cond_broadcast(progress->cond) != 0) {
- dmnsn_error(DMNSN_SEVERITY_MEDIUM, "Couldn't signal condition variable.");
- }
+ /* 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