aboutsummaryrefslogtreecommitdiffstats
path: root/src/condition.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/condition.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/condition.c b/src/condition.c
index c1fe8ed18..b23bed51e 100644
--- a/src/condition.c
+++ b/src/condition.c
@@ -26,8 +26,11 @@
void cond_init(struct condition *cond)
{
- xpthread_mutex_init(&cond->mutex, NULL);
- xpthread_cond_init(&cond->cond, NULL);
+ int err;
+ if ((err = pthread_mutex_init(&cond->mutex, NULL)))
+ FATAL("failed to init mutex: %s\n", strerror(err));
+ if ((err = pthread_cond_init(&cond->cond, NULL)))
+ FATAL("failed to init cond: %s\n", strerror(err));
}
void cond_enter(struct condition *cond)
@@ -82,6 +85,9 @@ void cond_signal_sync(struct condition *cond)
void cond_destroy(struct condition *cond)
{
- xpthread_cond_destroy(&cond->cond);
- xpthread_mutex_destroy(&cond->mutex);
+ int err;
+ if ((err = pthread_cond_destroy(&cond->cond)))
+ FATAL("failed to destroy cond: %s\n", strerror(err));
+ if ((err = pthread_mutex_destroy(&cond->mutex)))
+ FATAL("failed to destroy mutex: %s\n", strerror(err));
}