Thread (final @NotNull Runnable r) { Thread thread = myThreadFactory.newThread(r); thread.setName(POOLED_THREAD_PREFIX + counter.incrementAndGet()); thread.setPriority(Thread.NORM_PRIORITY - 1); BiConsumer<? super Thread, ? super Runnable> listener = newThreadListener; if (listener != null) { listener.accept(thread, r); } return thread; }