/** * Creates a new {@link NamedThreadFactory} instance * * @param threadNamePrefix the name prefix assigned to each thread created. */ public NamedThreadFactory(String threadNamePrefix) { final SecurityManager s = System.getSecurityManager(); group = (s != null) ? s.getThreadGroup() : Thread.currentThread() .getThreadGroup(); this.threadNamePrefix = String.format(Locale.ROOT, NAME_PATTERN, checkPrefix(threadNamePrefix), threadPoolNumber.getAndIncrement()); }
/** * Creates a new {@link NamedThreadFactory} instance * * @param threadNamePrefix the name prefix assigned to each thread created. */ public NamedThreadFactory(String threadNamePrefix) { final SecurityManager s = System.getSecurityManager(); group = (s != null) ? s.getThreadGroup() : Thread.currentThread() .getThreadGroup(); this.threadNamePrefix = String.format(Locale.ROOT, NAME_PATTERN, checkPrefix(threadNamePrefix), threadPoolNumber.getAndIncrement()); }
/** * Creates a new {@link NamedThreadFactory} instance * * @param threadNamePrefix the name prefix assigned to each thread created. */ public NamedThreadFactory(String threadNamePrefix) { final SecurityManager s = System.getSecurityManager(); group = (s != null) ? s.getThreadGroup() : Thread.currentThread() .getThreadGroup(); this.threadNamePrefix = String.format(Locale.ROOT, NAME_PATTERN, checkPrefix(threadNamePrefix), threadPoolNumber.getAndIncrement()); }
/** * Creates a new {@link NamedThreadFactory} instance * * @param threadNamePrefix the name prefix assigned to each thread created. */ public NamedThreadFactory(String threadNamePrefix) { final SecurityManager s = System.getSecurityManager(); group = (s != null) ? s.getThreadGroup() : Thread.currentThread() .getThreadGroup(); this.threadNamePrefix = String.format(Locale.ROOT, NAME_PATTERN, checkPrefix(threadNamePrefix), threadPoolNumber.getAndIncrement()); }