Code example for AtomicInteger

Methods: getAndAdd

0
    } 
 
    public Thread newThread(final Runnable r)
    { 
      final Thread t = new Thread(r);
      t.setName("Golden-Sample: " + getClass().getName() + "-" + threadNumber.getAndAdd(1));
      t.setDaemon(true);
      t.setPriority(3);
      return t;
    } 
  } 
 
  private class ExecuteReportRunner implements Runnable
  { 
    private String directory;
    private ReportProcessingMode processingMode;
    private List<Throwable> errors;
 
    private ExecuteReportRunner(final String directory,
                                final ReportProcessingMode processingMode,
                                final List<Throwable> errors)