File tree 1 file changed +4
-5
lines changed
src/main/java/com/ning/http/client/providers/grizzly 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 33
33
import org .glassfish .grizzly .nio .SelectorRunner ;
34
34
import org .glassfish .grizzly .ssl .SSLBaseFilter ;
35
35
import org .glassfish .grizzly .ssl .SSLFilter ;
36
+ import org .glassfish .grizzly .threadpool .Threads ;
36
37
import org .glassfish .grizzly .utils .Futures ;
37
38
38
39
import static com .ning .http .client .providers .grizzly .GrizzlyAsyncHttpProvider .getHttpTransactionContext ;
@@ -193,7 +194,7 @@ public void run() {
193
194
// If the current thread is a selector thread, we need to execute
194
195
// the remainder of the task on the worker thread to prevent
195
196
// it from being blocked.
196
- if (isCurrentThreadSelectorRunner ()) {
197
+ if (isServiceThread ()) {
197
198
c .getTransport ().getWorkerThreadPool ().execute (r );
198
199
} else {
199
200
r .run ();
@@ -204,10 +205,8 @@ public void run() {
204
205
// --------------------------------------------------------- Private Methods
205
206
206
207
207
- private boolean isCurrentThreadSelectorRunner () {
208
- final NIOConnection c = (NIOConnection ) context .getConnection ();
209
- final SelectorRunner runner = c .getSelectorRunner ();
210
- return (Thread .currentThread () == runner .getRunnerThread ());
208
+ private boolean isServiceThread () {
209
+ return Threads .isService ();
211
210
}
212
211
213
212
You can’t perform that action at this time.
0 commit comments