Code example for AtomicInteger

0
    public static final boolean DEBUG = false;
 
    private HashSet<String> mHistorySet = new HashSet<String>();
 
    private static final ThreadFactory sThreadFactory = new ThreadFactory() {
        private final AtomicInteger mCount = new AtomicInteger(1); 
 
        public Thread newThread(Runnable r) { 
            return new Thread(r, "StartupNews thread #" + mCount.getAndIncrement()); 
        } 
    }; 
 
    private ExecutorService mExecutorService;
 
    private static MyApplication me;
 
    public static MyApplication instance() { 
        return me;
    } 
 
    public MyApplication() {