mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 21:55:13 +00:00
Set background thread name
This commit is contained in:
parent
537bf56951
commit
3205db6798
1 changed files with 4 additions and 0 deletions
|
@ -82,6 +82,7 @@ import java.util.Locale;
|
|||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.mail.FolderClosedException;
|
||||
import javax.mail.MessageRemovedException;
|
||||
|
@ -99,9 +100,12 @@ public class Helper {
|
|||
static final String FAQ_URI = "https://github.com/M66B/open-source-email/blob/master/FAQ.md";
|
||||
|
||||
static ThreadFactory backgroundThreadFactory = new ThreadFactory() {
|
||||
private final AtomicInteger threadId = new AtomicInteger();
|
||||
|
||||
@Override
|
||||
public Thread newThread(@NonNull Runnable runnable) {
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.setName("FairEmail_" + threadId.getAndIncrement());
|
||||
thread.setPriority(THREAD_PRIORITY_BACKGROUND);
|
||||
return thread;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue