Skip to content

Commit

Permalink
Give network threads a unique name (#5847)
Browse files Browse the repository at this point in the history
  • Loading branch information
WickedShell authored and MobiDevelop committed Dec 2, 2019
1 parent 2161c43 commit b036f05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gdx/src/com/badlogic/gdx/net/NetJavaImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.net.URL;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue;
Expand Down Expand Up @@ -138,9 +139,10 @@ public NetJavaImpl (int maxThreads) {
60L, TimeUnit.SECONDS,
new SynchronousQueue<Runnable>(),
new ThreadFactory() {
AtomicInteger threadID = new AtomicInteger();
@Override
public Thread newThread(Runnable r) {
Thread thread = new Thread(r, "NetThread");
Thread thread = new Thread(r, "NetThread" + threadID.getAndIncrement());
thread.setDaemon(true);
return thread;
}
Expand Down

0 comments on commit b036f05

Please sign in to comment.