File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 31
31
import org .glassfish .grizzly .impl .FutureImpl ;
32
32
import org .glassfish .grizzly .nio .NIOConnection ;
33
33
import org .glassfish .grizzly .nio .SelectorRunner ;
34
+ import org .glassfish .grizzly .threadpool .Threads ;
34
35
import org .glassfish .grizzly .utils .Futures ;
35
36
36
37
import static java .lang .Boolean .TRUE ;
@@ -185,7 +186,7 @@ public void run() {
185
186
// If the current thread is a selector thread, we need to execute
186
187
// the remainder of the task on the worker thread to prevent
187
188
// it from being blocked.
188
- if (isCurrentThreadSelectorRunner ()) {
189
+ if (isServiceThread ()) {
189
190
c .getTransport ().getWorkerThreadPool ().execute (r );
190
191
} else {
191
192
r .run ();
@@ -196,10 +197,8 @@ public void run() {
196
197
// --------------------------------------------------------- Private Methods
197
198
198
199
199
- private boolean isCurrentThreadSelectorRunner () {
200
- final NIOConnection c = (NIOConnection ) context .getConnection ();
201
- final SelectorRunner runner = c .getSelectorRunner ();
202
- return (Thread .currentThread () == runner .getRunnerThread ());
200
+ private boolean isServiceThread () {
201
+ return Threads .isService ();
203
202
}
204
203
205
204
You can’t perform that action at this time.
0 commit comments