Maintaining a count with two threads using conditional variables
Couple of issues:

The code is not exception safe.
Any resource that has an open/close symantic should be handled via RAII

{
    pthread_mutex_lock (&amp;mutexA);

    // Code
    // This may throw an exception thus will
    // cause the code to miss the unlock.

    pthread_mutex_unlock (&amp;mutexA);
}


To fix this you should us an RAII locker object.

{
    MutexLocker    lock(mutexA);  // constructor calls lock.
                                  // detructor calls unlock.
    // Code
    // This may throw an exception
    // and it still works correctly.
}


It may work in this simple example:

    if (count &lt;= 0)
    {
        std :: cout &lt;&lt; "\ngnitiaW!\n";
        pthread_cond_wait (&amp;conditionVariableA, &amp;mutexA);   
    }


But normally you need to place the wait() inside a loop.

    while (count &lt;= 0)
    {
        std :: cout &lt;&lt; "\ngnitiaW!\n";
        pthread_cond_wait (&amp;conditionVariableA, &amp;mutexA);   
    }


If there are multiple threads that could enter this function then between the signal from the producer thread and this thread waking up from the wait another thread could have stolen the object. Thus you need to recheck the state you were waiting for and go back to sleep if it was stolen.

This would have been fixed by the MutexLocker above. But the code as it stands leaves the lock locked.

    else
    {
        // Do something.
        std :: cout &lt;&lt; "\nTime to enjoy!\n";

        // You are  returning early without unlock the lock.
        // This causes all your other threads to stall
        // and probably causes deadlock.
        return 0;
    }

    // This point is not reached if you return early.
    pthread_mutex_unlock (&amp;mutexA);