Stuck in pthread_cond_signal()

I am developing a multi-threaded library that helps the transformation of messages between threads in different processes using shared memory.

I am using the pthreads condition facility in order to synchronize access to the shared memory slots through which the messages are passed.

My test program got stuck. Obviously, most of the threads were stuck in the call to pthread_cond_wait(), waiting for a shared memory slot to become vacant.
However, what stuck the program was one of the threads who got stuck in
the call to pthread_cond_signal().
Obviously, since he got stuck there, none of the other threads awoke and consequently, the entire test program got stuck.

I will also mention that I am using the PTHREAD_PROCESS_SHARED attribute for the condition variable.

I am running on Ubuntu Linux 10.04.

Has anybody encountered a situation where pthread_cond_signal() is stuck?
Any idea about the reasons for this situation?

Thanks.

Sure. It is a common occurrence. Usually due to invalid assumptions regarding pthreads.

However if you want us to help you, you need to show us your code or, preferably, a short working example which demonstrates the problem.

Thank you for responding.
Producing the code for the forum would not be possible, if only because it is a part of a complicated project. I don't currently have a short working example.

My "waiter" code looks like:

pthread_mutex_lock(pWaiter->getMutex());
while (!pWaiter->getFlag())
pthread_cond_wait(pWaiter->getCond(), pWaiter->getMutex());
pthread_mutex_unlock(pWaiter->getMutex());

The "waker" side looks like:

pthread_mutex_lock(pWaitForRequest->getMutex());
pWaitForRequest->setFlag(true);
pthread_cond_signal(pWaitForRequest->getCond());
pthread_mutex_unlock(pWaitForRequest->getMutex());

Could someone who has experienced such a problem can suggest typical reeasons why the pthread_cond_signal() gets stuck in such a usage.

Thanks.