// Path: webimageloader/src/main/java/com/webimageloader/util/PriorityThreadFactory.java
// public class PriorityThreadFactory implements ThreadFactory {
//     private String name;
//     private int priority;
// 
//     private AtomicInteger count = new AtomicInteger(1);
// 
//     public PriorityThreadFactory(String name, int priority) {
//         this.name = name;
//         this.priority = priority;
//     }
// 
//     @Override
//     public Thread newThread(Runnable r) {
//         return new Thread(r, name + " #" + count.getAndIncrement()) {
//             @Override
//             public void run() {
//                 Process.setThreadPriority(priority);
// 
//                 super.run();
//             }
//         };
//     }
// }


import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.webimageloader.util.PriorityThreadFactory;
package com.webimageloader.loader;



public abstract class SimpleBackgroundLoader extends BackgroundLoader {
    public SimpleBackgroundLoader(String name, int priority, int threadCount) {
        super(createExecutor(name, priority, threadCount));
    }

    private static ExecutorService createExecutor(String name, int priority, int threadCount) {
// Path: webimageloader/src/main/java/com/webimageloader/util/PriorityThreadFactory.java
// public class PriorityThreadFactory implements ThreadFactory {
//     private String name;
//     private int priority;
// 
//     private AtomicInteger count = new AtomicInteger(1);
// 
//     public PriorityThreadFactory(String name, int priority) {
//         this.name = name;
//         this.priority = priority;
//     }
// 
//     @Override
//     public Thread newThread(Runnable r) {
//         return new Thread(r, name + " #" + count.getAndIncrement()) {
//             @Override
//             public void run() {
//                 Process.setThreadPriority(priority);
// 
//                 super.run();
//             }
//         };
//     }
// }


// Path: webimageloader/src/main/java/com/webimageloader/loader/SimpleBackgroundLoader.java
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.webimageloader.util.PriorityThreadFactory;

package com.webimageloader.loader;



public abstract class SimpleBackgroundLoader extends BackgroundLoader {
    public SimpleBackgroundLoader(String name, int priority, int threadCount) {
        super(createExecutor(name, priority, threadCount));
    }

    private static ExecutorService createExecutor(String name, int priority, int threadCount) {
        return Executors.newFixedThreadPool(threadCount, new PriorityThreadFactory(name, priority));