Code example for AtomicInteger

Methods: getAndIncrement

0
    /* (non-Javadoc) 
     * @see java.util.concurrent.ThreadFactory#newThread(java.lang.Runnable) 
     */ 
    public Thread newThread(Runnable runnable)
    {         
        String name = id + ":" + n.getAndIncrement();
        return new Thread(runnable, name);
    } 
}