feat(os): use recursive mutex by default (#6573)

This commit is contained in:
Gabor Kiss-Vamosi
2024-08-02 06:22:53 +02:00
committed by GitHub
parent a246b47e5a
commit a8c8275b56
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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) {
+7 -1
View File
@@ -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;