Skip to content

Conversation

@earlephilhower
Copy link
Owner

@earlephilhower earlephilhower commented Aug 25, 2022

Replace core and Newlib mutexes with FreeRTOS mutexes when in FreeRTOS mode.

Fixes #795

Wrap the mutex accesses for Newlib in vTaskPreemption(en/Dis)able

Avoid the case where a lock is acquired, the task is swapped out,
and another higher priority task is waiting on the lock.

Fixes part of #795
@earlephilhower earlephilhower changed the title Protect NEWLIB mutexes from task preemption Protect Newlib mutexes from task preemption under FreeRTOS Aug 26, 2022
Silently replace non-thread-aware mutexes with their FreeRTOS equivalent
and adjust all calls when building with FreeRTOS

Fixes #795
Make CureMutex handle generating and using a corresponding FreeRTOS mutex.

Clean up FreeRTOS core header refactorization.
@earlephilhower earlephilhower changed the title Protect Newlib mutexes from task preemption under FreeRTOS Protect core/Newlib mutexes from task preemption under FreeRTOS Aug 26, 2022
@earlephilhower earlephilhower merged commit bde4da2 into master Aug 29, 2022
@earlephilhower earlephilhower deleted the freertosmutex branch August 29, 2022 15:57
schkovich pushed a commit to schkovich/arduino-pico that referenced this pull request May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FreeRTOS deadlock on mutex_enter_blocking/recursive_mutex_enter_blocking

2 participants