public void unpush ( ) { // First, move 'back' one position backwards. if ( backPos > 0 ) { -- backPos ; } else { backPos = size - 1 ; backChunk = backChunk . prev ; } // Now, move 'end' position backwards. Note that obsolete end chunk // is not used as a spare chunk. The analysis shows that doing so // would require free and atomic operation per chunk deallocated // instead of a simple free. if ( endPos > 0 ) { -- endPos ; } else { endPos = size - 1 ; endChunk = endChunk . prev ; endChunk . next = null ; } }
unsynchronised thread .