mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-22 23:37:43 +08:00
feat(os): use recursive mutex by default (#6573)
This commit is contained in:
committed by
GitHub
parent
a246b47e5a
commit
a8c8275b56
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user