updated condition variable example