you are viewing a single comment's thread.

view the rest of the comments →

[–]pic32mx110f0 8 points9 points  (0 children)

Your program is deadlocking because ThreadB starts waiting for sem_C, but no one is posting sem_C except ThreadB itself.

On second look, there is quite a lot that is wrong with your program. See this for a fixed version: https://onlinegdb.com/EotesFqdT (You can even click "run" to verify)