From f31b4f46e17f2af17b4d6549d16e8f111b21688d Mon Sep 17 00:00:00 2001 From: Thomas Jansen Date: Sun, 28 Dec 2008 21:01:03 +0100 Subject: Remove xpthread_* wrappers --- src/condition.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/condition.c') 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)); } -- cgit v1.2.3