diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-10-20 18:55:00 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-10-20 18:55:00 +0200 |
commit | 170bf09308eaf600709b88fe98e472949924affd (patch) | |
tree | ffe87d358c84f5c7511df56a82854a6e3b6904cb /java/src | |
parent | Build lambda tests if JVM version >= 1.8 (diff) | |
download | ice-170bf09308eaf600709b88fe98e472949924affd.tar.bz2 ice-170bf09308eaf600709b88fe98e472949924affd.tar.xz ice-170bf09308eaf600709b88fe98e472949924affd.zip |
Fixed connect request handler to not invoke callback from a single thread
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Ice/src/main/java/IceInternal/ConnectRequestHandler.java | 50 |
1 files changed, 5 insertions, 45 deletions
diff --git a/java/src/Ice/src/main/java/IceInternal/ConnectRequestHandler.java b/java/src/Ice/src/main/java/IceInternal/ConnectRequestHandler.java index a5f92ac090c..c1636662c8c 100644 --- a/java/src/Ice/src/main/java/IceInternal/ConnectRequestHandler.java +++ b/java/src/Ice/src/main/java/IceInternal/ConnectRequestHandler.java @@ -293,18 +293,7 @@ public class ConnectRequestHandler // from the client thread pool since this will result in ice_exception callbacks to be // called. // - if(!_requests.isEmpty()) - { - _reference.getInstance().clientThreadPool().dispatch(new DispatchWorkItem(_connection) - { - @Override - public void - run() - { - flushRequestsWithException(); - }; - }); - } + flushRequestsWithException(); notifyAll(); } @@ -414,7 +403,7 @@ public class ConnectRequestHandler if((request.outAsync.send(_connection, _compress, _response) & AsyncStatus.InvokeSentCallback) > 0) { - sentCallbacks.add(request.outAsync); + request.outAsync.invokeSentAsync(); } } else @@ -449,14 +438,7 @@ public class ConnectRequestHandler { assert(_exception == null && !_requests.isEmpty()); _exception = ex.get(); - _reference.getInstance().clientThreadPool().dispatch(new DispatchWorkItem(_connection) - { - @Override - public void run() - { - flushRequestsWithException(); - }; - }); + flushRequestsWithException(); } } catch(final Ice.LocalException ex) @@ -465,32 +447,10 @@ public class ConnectRequestHandler { assert(_exception == null && !_requests.isEmpty()); _exception = ex; - _reference.getInstance().clientThreadPool().dispatch(new DispatchWorkItem(_connection) - { - @Override - public void run() - { - flushRequestsWithException(); - }; - }); + flushRequestsWithException(); } } - if(!sentCallbacks.isEmpty()) - { - _reference.getInstance().clientThreadPool().dispatch(new DispatchWorkItem(_connection) - { - @Override - public void run() - { - for(OutgoingAsyncBase callback : sentCallbacks) - { - callback.invokeSent(); - } - }; - }); - } - // // We've finished sending the queued requests and the request handler now send // the requests over the connection directly. It's time to substitute the @@ -555,7 +515,7 @@ public class ConnectRequestHandler { if(request.outAsync.completed(_exception)) { - request.outAsync.invokeCompleted(); + request.outAsync.invokeCompletedAsync(); } } } |