protected void skipToBeDeleted ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "skipToBeDeleted" ) ; Token nextToken = availableHead ; // Move forward past any links that are to be deleted. These might be there // because other links ahead of them have now been removed, or because a // delete of a link backed out possibly reinstating it near the head of the list. // See Link.postBackout. skipToBeDeleted : while ( nextToken != null ) { Link nextLink = ( Link ) ( nextToken . getManagedObject ( ) ) ; if ( nextLink . state != Link . stateToBeDeleted && nextLink . state != Link . stateMustBeDeleted ) break skipToBeDeleted ; nextToken = nextLink . next ; // Try the folowing link. } // while (nextToken != null ). availableHead = nextToken ; // Remember what we skipped. if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "skipToBeDeleted" ) ; }
Move the availableHead past any ToBeDeleted links . Caller must be synchronized on LinkedList .