Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect core/Newlib mutexes from task preemption under FreeRTOS #798

Merged
merged 11 commits into from
Aug 29, 2022

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
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
1 participant