From 6c2d47111003763d0f81cab83e1e7d24544dd852 Mon Sep 17 00:00:00 2001 From: Alex Rudyy Date: Tue, 20 Jan 2015 18:03:19 +0000 Subject: QPID-6259: Fix stopping of BDB committer from committer thread git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1653320 13f79535-47bb-0310-9956-ffa450edef68 --- .../server/store/berkeleydb/CoalescingCommiter.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'qpid/java') diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/CoalescingCommiter.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/CoalescingCommiter.java index ff383ecf97..964335869d 100644 --- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/CoalescingCommiter.java +++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/CoalescingCommiter.java @@ -50,14 +50,17 @@ public class CoalescingCommiter implements Committer public void stop() { _commitThread.close(); - try + if (Thread.currentThread() != _commitThread) { - _commitThread.join(); - } - catch (InterruptedException ie) - { - Thread.currentThread().interrupt(); - throw new RuntimeException("Commit thread has not shutdown", ie); + try + { + _commitThread.join(); + } + catch (InterruptedException ie) + { + Thread.currentThread().interrupt(); + throw new RuntimeException("Commit thread has not shutdown", ie); + } } } -- cgit v1.2.1