nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

Replace all place which use semaphore as lock with mutex wrapper

Open xiaoxiang781216 opened this issue 3 years ago • 4 comments

See the discussion: https://github.com/apache/incubator-nuttx/pull/5070 and https://www.mail-archive.com/[email protected]/msg07312.html

xiaoxiang781216 avatar Jan 06 '22 14:01 xiaoxiang781216

@xiaoxiang781216 will we improve mutex wrapper to check for holder before releasing a mutex or a separate ticket should be created for that? Currently mutex can be released from a task that is not holding it.

pkarashchenko avatar Jan 08 '22 20:01 pkarashchenko

it can be added in the separate PR. Maybe need to enabled in the debug mode to save the space.

xiaoxiang781216 avatar Jan 09 '22 03:01 xiaoxiang781216

I think that probably a good way will be to move priority inheritance from sem to mutex and clean-up priority inheritance APIs for semaphores after we switch to mutexes in code

pkarashchenko avatar Jan 22 '22 09:01 pkarashchenko

Yes, this is the safe path to fix the priority inheritance issue.

xiaoxiang781216 avatar Jan 22 '22 14:01 xiaoxiang781216