Lock queue when size is zero