Back to project page Android-Fast-ImageLoader.
The source code is released under:
Apache License
If you think the Android project Android-Fast-ImageLoader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sunny.threadpool; //from w w w .jav a 2s. c o m import android.os.Process; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; public class PriorityThreadFactory implements ThreadFactory { private final String name; private final AtomicInteger number = new AtomicInteger(); private final int priority; public PriorityThreadFactory(String name, int priority) { this.name = name; this.priority = priority; } @Override public Thread newThread(Runnable r) { return new Thread(r, this.name + ":" + number.getAndIncrement()) { @Override public void run() { Process.setThreadPriority(PriorityThreadFactory.this.priority); super.run(); } }; } }