2 * Copyright (C) 2015 Czech Technical University in Prague
5 * - Michal Sojka <sojkam1@fel.cvut.cz>
7 * This document contains proprietary information belonging to Czech
8 * Technical University in Prague. Passing on and copying of this
9 * document, and communication of its contents is not permitted
10 * without prior written authorization.
17 #ifndef RPP_THREADSAFE
18 #define RPP_THREADSAFE 1
23 #include <os/semphr.h>
25 #define RPP_MUTEX_DEFINE(mutex) static xSemaphoreHandle mutex
26 #define RPP_MUTEX_INIT(mutex) (((mutex) = xSemaphoreCreateMutex()) != NULL)
27 #define RPP_MUTEX_LOCK(mutex) xSemaphoreTake((mutex), portMAX_DELAY)
28 #define RPP_MUTEX_UNLOCK(mutex) xSemaphoreGive(mutex)
32 #define RPP_MUTEX_DEFINE(mutex)
33 #define RPP_MUTEX_INIT(mutex) true
34 #define RPP_MUTEX_LOCK(mutex)
35 #define RPP_MUTEX_UNLOCK(mutex)