From 96075ed2c1f2f7172a87f7d6a5a10697f0135b12 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 25 Dec 2015 00:23:21 +0100 Subject: [PATCH] sema: introduce static initializer --- sys/include/sema.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/include/sema.h b/sys/include/sema.h index b57e7b489..e6545ecf7 100644 --- a/sys/include/sema.h +++ b/sys/include/sema.h @@ -30,6 +30,15 @@ extern "C" { #endif +/** + * @brief Creates semaphore statically. + * + * @param[in] value Initial value for the semaphore. + * + * @return Statically initialized semaphore. + */ +#define SEMA_CREATE(value) { (value), PRIORITY_QUEUE_INIT } + /** * @brief A Semaphore. */ @@ -39,7 +48,7 @@ typedef struct { } sema_t; /** - * @brief Creates semaphore. + * @brief Creates semaphore dynamically. * * @see * The Open Group Base Specifications Issue 7, sem_init()