Code example for AtomicInteger

0
      }; 
    } 
 
    @Override Executor defaultHttpExecutor() {
      return Executors.newCachedThreadPool(new ThreadFactory() {
        private final AtomicInteger threadCounter = new AtomicInteger();
 
        @Override public Thread newThread(final Runnable r) {
          return new Thread(new Runnable() {
            @Override public void run() { 
              Process.setThreadPriority(THREAD_PRIORITY_BACKGROUND);
              r.run();
            } 
          }, THREAD_PREFIX + threadCounter.getAndIncrement());
        } 
      }); 
    } 
 
    @Override Executor defaultCallbackExecutor() {
      return new MainThreadExecutor(); 
    }