Code example for AtomicInteger

Methods: getAndIncrement

0
        public BackgroundLoaderThreadFactory(String tag) {
            mTag = tag;
        } 
 
        public Thread newThread(final Runnable r) {
            Thread t =  new Thread(r, mTag + "-" + mCount.getAndIncrement());
 
            if (t.getPriority() != Thread.MIN_PRIORITY)
                t.setPriority(Thread.MIN_PRIORITY);
 
            return t;
        } 
    } 
} 
Experience pair programming with AI  Get Codota for Java