Issue #4096 - allow thread to exit ReservedThreadExecutor on stop
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
42f1214796
commit
168a95d334
|
@ -163,6 +163,9 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec
|
|||
{
|
||||
if (_lease != null)
|
||||
_lease.close();
|
||||
|
||||
super.doStop();
|
||||
|
||||
while (true)
|
||||
{
|
||||
ReservedThread thread = _stack.pollFirst();
|
||||
|
@ -171,7 +174,6 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec
|
|||
_size.decrementAndGet();
|
||||
thread.stop();
|
||||
}
|
||||
super.doStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -277,7 +279,7 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec
|
|||
LOG.debug("{} waiting", this);
|
||||
|
||||
Runnable task = null;
|
||||
while (task == null)
|
||||
while (isRunning() && task == null)
|
||||
{
|
||||
boolean idle = false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue