Code example for ThreadFactory

Methods: newThread

0
    this.backingFactory = backingFactory;
    makeName(0); // fail fast if format is bad 
  } 
 
  public Thread newThread(Runnable r) {
    Thread t = backingFactory.newThread(r);
    t.setName(makeName(count.getAndIncrement()));
    return t;
  } 
 
  private String makeName(int ordinal) {
    return String.format(format, ordinal);
  } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE