public synchronized void releaseId ( short id ) throws IdAllocatorException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "releaseId" , "" + id ) ; deallocate ( id ) ; // If we are releasing the id 1 less than the next id, set the next id to this one if ( id == ( nextId - 1 ) ) { nextId = id ; // Ensure the next free id is not this as well if ( nextId == lastFreeId ) { lastFreeId = NULL_ID ; } } // Otherwise save this id away so we can allocate it quickly else { lastFreeId = id ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "releaseId" ) ; }
Releases an ID making it available to be allocated once more .