FreeRTOS: replace DDS_TRACE+abort by DDS_FATAL

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-08-19 13:08:36 +02:00 committed by eboasson
parent 5b2cc4e6f3
commit f06d3bf9ad

View file

@ -49,7 +49,6 @@ mutex_lock(ddsrt_mutex_t *mutex, int blk)
assert(mutex != NULL); assert(mutex != NULL);
if (xSemaphoreTake(mutex->sem, (blk == 1 ? portMAX_DELAY : 0)) != pdPASS) { if (xSemaphoreTake(mutex->sem, (blk == 1 ? portMAX_DELAY : 0)) != pdPASS) {
DDS_TRACE("Failed to lock 0x%p", mutex);
/* xSemaphoreTake will only return pdFAIL on timeout. The wait will be /* xSemaphoreTake will only return pdFAIL on timeout. The wait will be
indefinite if INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h indefinite if INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h
and portMAX_DELAY was passed. */ and portMAX_DELAY was passed. */
@ -63,7 +62,7 @@ mutex_lock(ddsrt_mutex_t *mutex, int blk)
void ddsrt_mutex_lock(ddsrt_mutex_t *mutex) void ddsrt_mutex_lock(ddsrt_mutex_t *mutex)
{ {
if (!mutex_lock(mutex, 1)) { if (!mutex_lock(mutex, 1)) {
abort(); DDS_FATAL("Failed to lock 0x%p", mutex);
} }
} }
@ -77,8 +76,7 @@ void ddsrt_mutex_unlock(ddsrt_mutex_t *mutex)
assert(mutex != NULL); assert(mutex != NULL);
if (xSemaphoreGive(mutex->sem) != pdPASS) { if (xSemaphoreGive(mutex->sem) != pdPASS) {
DDS_TRACE("Failed to unlock 0x%p", mutex->sem); DDS_FATAL("Failed to unlock 0x%p", mutex->sem);
abort();
} }
} }