Nested Mutexes and Priority Inheritance

rtel wrote on Tuesday, March 23, 2010:

Whether or not it will cause problems depends on the the priorities of the tasks holding the mutexes.

The priority inheritance assumes that only one mutex will be held at a time.  If two mutexes are held then the priority will be inherited to that of the highest task priority that is attempting to access the same mutex, but will be dropped back to the base priority when either mutex is returned.  This could result in some priority inversion, but this won’t necessarily cause you a problem, and in fact some inversion must have already existed for the inheritance to have been triggered in the first place.

Regards.