diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-09-25 17:07:18 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-09-25 17:07:18 +0200 |
commit | 089aed778ab4002336fbada8c4dc4e8b25f33a8c (patch) | |
tree | 6188b69af9d8c58e6dbc2079ca6da9d3e5976d1a /java/src/IceInternal/RetryTask.java | |
parent | New fix for (ICE-5583) to always use a custom chain engine (diff) | |
download | ice-089aed778ab4002336fbada8c4dc4e8b25f33a8c.tar.bz2 ice-089aed778ab4002336fbada8c4dc4e8b25f33a8c.tar.xz ice-089aed778ab4002336fbada8c4dc4e8b25f33a8c.zip |
Fixed again ICE-5687 - adapterDeactivation test warnings
Diffstat (limited to 'java/src/IceInternal/RetryTask.java')
-rw-r--r-- | java/src/IceInternal/RetryTask.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/java/src/IceInternal/RetryTask.java b/java/src/IceInternal/RetryTask.java index 2c991f65819..713c8bc856a 100644 --- a/java/src/IceInternal/RetryTask.java +++ b/java/src/IceInternal/RetryTask.java @@ -21,17 +21,26 @@ class RetryTask implements Runnable public void run() { - if(_queue.remove(this)) - { - _outAsync.processRetry(false); - } + _outAsync.processRetry(false); + + // + // NOTE: this must be called last, destroy() blocks until all task + // are removed to prevent the client thread pool to be destroyed + // (we still need the client thread pool at this point to call + // exception callbacks with CommunicatorDestroyedException). + // + _queue.remove(this); } - public void + public boolean destroy() { - _future.cancel(false); - _outAsync.processRetry(true); + if(_future.cancel(false)) + { + _outAsync.processRetry(true); + return true; + } + return false; } public void setFuture(java.util.concurrent.Future<?> future) |