private void cleanupAll(){
  T current;
  while ((current=objects.poll()) != null)   cleanup(current);
}

private void cleanupAll ( ) { T current ; while ( ( current = objects . poll ( ) ) != null ) cleanup ( current ) ; }
invokes the cleanup ( ) function on all tracked objects , removing each object from the underlying collection . it is guaranteed that cleanup ( ) will be invoked only once for each object , even if multiple calls to cleanupall ( ) are running concurrently , and that the underlying collection will be empty after all calls to cleanupall ( ) complete .
