aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-06-30 02:43:17 +0000
committerEric Wong <normalperson@yhbt.net>2008-06-30 02:43:17 +0000
commitd82a4aff2524e68ad56efca68723792296950713 (patch)
tree3e4db1b581fe0d2177f9cf39a0087283b41913ab /src/utils.c
parent2a5dcba5edaaf241ea85ec6cad7ccd9665774ee4 (diff)
downloadmpd-d82a4aff2524e68ad56efca68723792296950713.tar.gz
mpd-d82a4aff2524e68ad56efca68723792296950713.tar.xz
mpd-d82a4aff2524e68ad56efca68723792296950713.zip
utils: pthread_{mutex,cond}_init can fail, so check for it
git-svn-id: https://svn.musicpd.org/mpd/trunk@7394 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index eedae22de..332c73587 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -241,6 +241,20 @@ void init_async_pipe(int file_des[2])
FATAL("Couldn't set non-blocking I/O: %s\n", strerror(errno));
}
+void xpthread_mutex_init(pthread_mutex_t *m, const pthread_mutexattr_t *a)
+{
+ int err;
+ if ((err = pthread_mutex_init(m, a)))
+ FATAL("failed to init mutex: %s\n", strerror(err));
+}
+
+void xpthread_cond_init(pthread_cond_t *c, pthread_condattr_t *a)
+{
+ int err;
+ if ((err = pthread_cond_init(c, a)))
+ FATAL("failed to init cond: %s\n", strerror(err));
+}
+
void xpthread_mutex_destroy(pthread_mutex_t *mutex)
{
int err;