@@ -107,16 +107,16 @@ public Thread newThread(Runnable r) {
107
107
}
108
108
});
109
109
110
- this .eventLoopGroupBoss = new NioEventLoopGroup (1 , new ThreadFactory () {
111
- private AtomicInteger threadIndex = new AtomicInteger (0 );
110
+ if (useEpoll ()) {
111
+ this .eventLoopGroupBoss = new EpollEventLoopGroup (1 , new ThreadFactory () {
112
+ private AtomicInteger threadIndex = new AtomicInteger (0 );
112
113
113
- @ Override
114
- public Thread newThread (Runnable r ) {
115
- return new Thread (r , String .format ("NettyBoss_ %d" , this .threadIndex .incrementAndGet ()));
116
- }
117
- });
114
+ @ Override
115
+ public Thread newThread (Runnable r ) {
116
+ return new Thread (r , String .format ("NettyEPOLLBoss_ %d" , this .threadIndex .incrementAndGet ()));
117
+ }
118
+ });
118
119
119
- if (useEpoll ()) {
120
120
this .eventLoopGroupSelector = new EpollEventLoopGroup (nettyServerConfig .getServerSelectorThreads (), new ThreadFactory () {
121
121
private AtomicInteger threadIndex = new AtomicInteger (0 );
122
122
private int threadTotal = nettyServerConfig .getServerSelectorThreads ();
@@ -127,6 +127,15 @@ public Thread newThread(Runnable r) {
127
127
}
128
128
});
129
129
} else {
130
+ this .eventLoopGroupBoss = new NioEventLoopGroup (1 , new ThreadFactory () {
131
+ private AtomicInteger threadIndex = new AtomicInteger (0 );
132
+
133
+ @ Override
134
+ public Thread newThread (Runnable r ) {
135
+ return new Thread (r , String .format ("NettyNIOBoss_%d" , this .threadIndex .incrementAndGet ()));
136
+ }
137
+ });
138
+
130
139
this .eventLoopGroupSelector = new NioEventLoopGroup (nettyServerConfig .getServerSelectorThreads (), new ThreadFactory () {
131
140
private AtomicInteger threadIndex = new AtomicInteger (0 );
132
141
private int threadTotal = nettyServerConfig .getServerSelectorThreads ();
0 commit comments