Keil Logo Arm Logo

Mutex not Released. Which Thread holds the Mutex?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
Kai Neumann
Posted
10-Apr-2017 15:42 GMT
Toolset
ARM
New! Mutex not Released. Which Thread holds the Mutex?

Hello,

I have a problem with an application using the KEIL RTX. The application consists of 30-40 Tasks which use several Mutex to control the access to shared ressources. The problem I have now is that one mutex that is used by almost all tasks seems to be not released anywhere in the code.
Is there any way to see which task holds the Mutex? I know, i could also just check the code (which would be a bunch of work) but we had the case, that some function call to an external library would not return and therefore the Mutex would not be released. So this is not very helpful.
Is there any way to see which tasks has the Mutex?

Kind Regards

Author
Tamir Michael
Posted
11-Apr-2017 08:46 GMT
Toolset
ARM
New! RE: Mutex not Released. Which Thread holds the Mutex?

What you can try is observe the part in the kernel RAM that maintains this information. This is indeed useful information to be conveyed by an IDE that is kernel aware, as well as the PC of each task...

Author
Kai Neumann
Posted
18-Apr-2017 14:02 GMT
Toolset
ARM
New! RE: Mutex not Released. Which Thread holds the Mutex?

Okay. But where do I find this information? Is it somehow stored inside the Mutex itself, which is defined as 'typedef U32 OS_MUT[4];'?

Author
Westonsupermare Pier
Posted
18-Apr-2017 20:04 GMT
Toolset
ARM
New! RE: Mutex not Released. Which Thread holds the Mutex?

Honestly is sounds like you need to do a bunch of work to get a handle on the out of control code. Instrument it, and understand it, add your own wrappers to make sure it is taken/released consistently in a bracketed fashion. Your current tack seems to be to play whack-a-mole without a clear vision about how the architecture is supposed to function, and whether that can be simplified or optimized. If all the tasks take this one mutex, perhaps you need to refactor the tasks.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

ARM’s Privacy Policy has been updated. By continuing to use our site, you consent to ARM’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.