X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fsemaphore.h;h=7b211f8e1c9d1d3a0b746bad68531074b87c9c41;hb=0eb6d8317cdbdb28663ff779d31684b3c7a47274;hp=a2bc8959118f84d66eee67a6b976a5a75511ad06;hpb=a4fe009d3366b0a3e119713b0ecc7fc0070efdfa;p=libucw.git diff --git a/ucw/semaphore.h b/ucw/semaphore.h index a2bc8959..7b211f8e 100644 --- a/ucw/semaphore.h +++ b/ucw/semaphore.h @@ -18,13 +18,12 @@ #include #include -#include "ucw/fastbuf.h" // For the temp_file_name +#include // For the temp_file_name /* In Darwin, sem_init() is unfortunately not implemented and the guide * recommends emulating it using sem_open(). */ -static inline sem_t * -sem_alloc(void) +static inline sem_t *sem_alloc(void) { char buf[TEMP_FILE_NAME_LEN]; int mode, retry = 10; @@ -39,16 +38,14 @@ sem_alloc(void) return sem; } -static inline void -sem_free(sem_t *sem) +static inline void sem_free(sem_t *sem) { sem_close(sem); } #else -static inline sem_t * -sem_alloc(void) +static inline sem_t *sem_alloc(void) { sem_t *sem = xmalloc(sizeof(sem_t)); int res = sem_init(sem, 0, 0); @@ -56,8 +53,7 @@ sem_alloc(void) return sem; } -static inline void -sem_free(sem_t *sem) +static inline void sem_free(sem_t *sem) { sem_destroy(sem); xfree(sem);