aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/osal/lv_freertos.c2
-rw-r--r--src/osal/lv_pthread.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/osal/lv_freertos.c b/src/osal/lv_freertos.c
index 2dfd323bd..80d16a1e8 100644
--- a/src/osal/lv_freertos.c
+++ b/src/osal/lv_freertos.c
@@ -364,7 +364,7 @@ static void prvRunThread(void * pxArg)
static void prvMutexInit(lv_mutex_t * pxMutex)
{
- pxMutex->xMutex = xSemaphoreCreateMutex();
+ pxMutex->xMutex = xSemaphoreCreateRecursiveMutex();
/* Ensure that the FreeRTOS mutex was successfully created. */
if(pxMutex->xMutex == NULL) {
diff --git a/src/osal/lv_pthread.c b/src/osal/lv_pthread.c
index 3fde24638..268f055c2 100644
--- a/src/osal/lv_pthread.c
+++ b/src/osal/lv_pthread.c
@@ -64,7 +64,13 @@ lv_result_t lv_thread_delete(lv_thread_t * thread)
lv_result_t lv_mutex_init(lv_mutex_t * mutex)
{
- int ret = pthread_mutex_init(mutex, NULL);
+ pthread_mutexattr_t attr;
+
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ int ret = pthread_mutex_init(mutex, &attr);
+ pthread_mutexattr_destroy(&attr);
+
if(ret) {
LV_LOG_WARN("Error: %d", ret);
return LV_RESULT_INVALID;