org.osmdroid.tileprovider.modules.ConfigurablePriorityThreadFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of osmdroid-android Show documentation
Show all versions of osmdroid-android Show documentation
An Android library to display OpenStreetMap views.
package org.osmdroid.tileprovider.modules;
import java.util.concurrent.ThreadFactory;
/**
*
* @author Jastrzab
*/
public class ConfigurablePriorityThreadFactory implements ThreadFactory {
private final int mPriority;
private final String mName;
public ConfigurablePriorityThreadFactory(final int pPriority, final String pName) {
mPriority = pPriority;
mName = pName;
}
@Override
public Thread newThread(final Runnable pRunnable) {
final Thread thread = new Thread(pRunnable);
thread.setPriority(mPriority);
if (mName != null) {
thread.setName(mName);
}
return thread;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy