Giriş
Şu satırı dahil ederiz.
Şöyle yaparız.
Şu satırı dahil ederiz.
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
namingPattern metoduŞöyle yaparız.
// Create a factory that produces daemon threads with a naming pattern and
// a priority
BasicThreadFactory factory = new BasicThreadFactory.Builder()
.namingPattern("workerthread-%d")
.daemon(true)
.priority(Thread.MAX_PRIORITY)
.build();
// Create an executor service for single-threaded execution
ExecutorService exec = Executors.newSingleThreadExecutor(factory);
Hiç yorum yok:
Yorum Gönder