From d22b71af47b44c1c1d84195743c34b589e6ab19c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 20 Feb 2010 00:47:45 +0100 Subject: src: reindent for 8ch indenting I am slowly moving all my projects to kernel-inspired 8ch indenting. This will break patches that haven't been merged yet, which I am aware of, but OTOH in times of git's --ignore-space-change shouldn't be too problematic. Yes, I am aware that reindenting like this sucks, but I cannot stand 4ch indenting anymore. Sorry. --- src/mutex-posix.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'src/mutex-posix.c') diff --git a/src/mutex-posix.c b/src/mutex-posix.c index 8d8b88b..0875c52 100644 --- a/src/mutex-posix.c +++ b/src/mutex-posix.c @@ -1,3 +1,5 @@ +/*-*- Mode: C; c-basic-offset: 8 -*-*/ + /*** This file is part of libcanberra. @@ -29,50 +31,50 @@ #include "malloc.h" struct ca_mutex { - pthread_mutex_t mutex; + pthread_mutex_t mutex; }; ca_mutex* ca_mutex_new(void) { - ca_mutex *m; + ca_mutex *m; - if (!(m = ca_new(ca_mutex, 1))) - return NULL; + if (!(m = ca_new(ca_mutex, 1))) + return NULL; - if (pthread_mutex_init(&m->mutex, NULL) < 0) { - ca_free(m); - return NULL; - } + if (pthread_mutex_init(&m->mutex, NULL) < 0) { + ca_free(m); + return NULL; + } - return m; + return m; } void ca_mutex_free(ca_mutex *m) { - ca_assert(m); + ca_assert(m); - ca_assert_se(pthread_mutex_destroy(&m->mutex) == 0); - ca_free(m); + ca_assert_se(pthread_mutex_destroy(&m->mutex) == 0); + ca_free(m); } void ca_mutex_lock(ca_mutex *m) { - ca_assert(m); + ca_assert(m); - ca_assert_se(pthread_mutex_lock(&m->mutex) == 0); + ca_assert_se(pthread_mutex_lock(&m->mutex) == 0); } ca_bool_t ca_mutex_try_lock(ca_mutex *m) { - int r; - ca_assert(m); + int r; + ca_assert(m); - if ((r = pthread_mutex_trylock(&m->mutex)) != 0) { - ca_assert(r == EBUSY); - return FALSE; - } + if ((r = pthread_mutex_trylock(&m->mutex)) != 0) { + ca_assert(r == EBUSY); + return FALSE; + } - return TRUE; + return TRUE; } void ca_mutex_unlock(ca_mutex *m) { - ca_assert(m); + ca_assert(m); - ca_assert_se(pthread_mutex_unlock(&m->mutex) == 0); + ca_assert_se(pthread_mutex_unlock(&m->mutex) == 0); } -- cgit