Code example for BlockingQueue

Methods: isEmpty

   * Returns {@code true} if RSS feeds are currently being loaded, {@code false} 
   * otherwise. 
  public boolean isLoading() { 
    // order of conjuncts matters because of happens-before relationship 
    return !in.isEmpty() && !stopped;
   * Stop thread after finishing loading pending RSS feed URIs. If this loader 
   * has been constructed with {@link #priority()} or {@link #priority(int)}, 
   * only RSS feed loads with priority strictly greater than seven (7) are going 
   * to be completed. 
   * <p> 
   * Subsequent invocations of {@link #load(String)} and 
   * {@link #load(String, int)} return {@code null}. 
  public void stop() { 
    // flag writings happen-before enqueue 
    stopped = true;