@@ -129,6 +129,7 @@ public void removeAllCallbacks(Object scheduled) {
129129 }
130130 }
131131
132+ private static ExecutorService synchronousWorkers = newSynchronousWorkers ("AsyncServer-worker-" );
132133 private static void wakeup (final SelectorWrapper selector ) {
133134 synchronousWorkers .execute (new Runnable () {
134135 @ Override
@@ -418,8 +419,8 @@ public Cancellable connectSocket(final String host, final int port, final Connec
418419 return connectSocket (InetSocketAddress .createUnresolved (host , port ), callback );
419420 }
420421
421- private static ExecutorService newSynchronousWorkers () {
422- ThreadFactory tf = new NamedThreadFactory ("AsyncServer-worker-" );
422+ private static ExecutorService newSynchronousWorkers (String prefix ) {
423+ ThreadFactory tf = new NamedThreadFactory (prefix );
423424 ThreadPoolExecutor tpe = new ThreadPoolExecutor (1 , 4 , 10L ,
424425 TimeUnit .SECONDS , new LinkedBlockingQueue <Runnable >(), tf );
425426 return tpe ;
@@ -438,10 +439,10 @@ public int compare(InetAddress lhs, InetAddress rhs) {
438439 }
439440 };
440441
441- private static ExecutorService synchronousWorkers = newSynchronousWorkers ();
442+ private static ExecutorService synchronousResolverWorkers = newSynchronousWorkers ("AsyncServer-resolver-" );
442443 public Future <InetAddress []> getAllByName (final String host ) {
443444 final SimpleFuture <InetAddress []> ret = new SimpleFuture <InetAddress []>();
444- synchronousWorkers .execute (new Runnable () {
445+ synchronousResolverWorkers .execute (new Runnable () {
445446 @ Override
446447 public void run () {
447448 try {
0 commit comments