Skip to content

Commit ff2d6b3

Browse files
committed
Make callback thread names unique.
1 parent 6918f3c commit ff2d6b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.util.concurrent.Executors;
3636
import java.util.concurrent.ScheduledExecutorService;
3737
import java.util.concurrent.ThreadFactory;
38+
import java.util.concurrent.atomic.AtomicInteger;
3839

3940
/**
4041
* Configuration class to use with a {@link AsyncHttpClient}. System property can be also used to configure this
@@ -1218,9 +1219,10 @@ public Thread newThread(Runnable r) {
12181219
if (applicationThreadPool == null) {
12191220
applicationThreadPool =
12201221
Executors.newCachedThreadPool(new ThreadFactory() {
1222+
final AtomicInteger counter = new AtomicInteger();
12211223
public Thread newThread(Runnable r) {
12221224
Thread t = new Thread(r,
1223-
"AsyncHttpClient-Callback");
1225+
"AsyncHttpClient-Callback-" + counter.incrementAndGet());
12241226
t.setDaemon(true);
12251227
return t;
12261228
}

0 commit comments

Comments
 (0)