This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Checking Mutex state

Using Keil 5.15. Have about 20 mutexes created throughout our system. How do I check the state of each mutex? Can I see which task owns it?

Parents Reply Children
  • Below is what the 4 uint32's for a mutex look like. Obviously subject to change at any time, but it has been stable since they first implemented mutex's.

    typedef struct OS_MUCB {
      U8     cb_type;                 /* Control Block Type                      */
      U16    level;                   /* Call nesting level                      */
      struct OS_TCB *p_lnk;           /* Chain of tasks waiting for mutex        */
      struct OS_TCB *owner;           /* Mutex owner task                        */
      struct OS_MUCB *p_mlnk;         /* Chain of mutexes by owner task          */
    } *P_MUCB;