Semaphore Locks?

We are using QNX 6.3.0 service pack 3. We have a binary semaphore that is accessed by several processes (about 15) to access a shared memory area. Processes have 7 different priorities (so some of them have same priorities). While reviewing the code, I found out that some functions access the shared memory area without locking/unlocking the semaphore. When I added proper locking of the semaphore and then accessing the shared memory area and then releasing the semaphore as is done with all the other functions, we end up with all the processes get hang waiting for the semaphore to unlock. There is no obvious locking and then not unlocking errors.
My question is, is there a known limitations about binary semaphores that I am not aware of?

Thanks for any help.

Kind Regards,

You might want to use mutex as they respect priorities.

My first guess is that your code is missing an unlock somewhere. I find that wrapping mutex/semaphore in a C++ object makes it safer in that regard.