using conditions in synchronized code