-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Mark mutex as robust to prevent deadlocks #1233
base: main
Are you sure you want to change the base?
Conversation
Prevent application hangs that occur when a thread dies while holding a mutex, particularly during vTaskEndScheduler or exit calls. This is achieved by setting the PTHREAD_MUTEX_ROBUST attribute on the mutex. Fixes: - GitHub issue: FreeRTOS#1217 - Forum thread: freertos.org/t/22287 Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1233 +/- ##
==========================================
- Coverage 91.64% 91.53% -0.11%
==========================================
Files 6 6
Lines 3254 3260 +6
Branches 903 901 -2
==========================================
+ Hits 2982 2984 +2
- Misses 132 135 +3
- Partials 140 141 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Gaurav Aggarwal <[email protected]>
Quality Gate passedIssues Measures |
Tested on my end. |
Description
Prevent application hangs that occur when a thread dies while holding a mutex, particularly during vTaskEndScheduler or exit calls. This is achieved by setting the PTHREAD_MUTEX_ROBUST attribute on the mutex.
Test Steps
Tested locally using the modified application as suggested in this thread. Was also tested by @denravonska.
Checklist:
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.