[asterisk-scf-commits] asterisk-scf/integration/ice-util-cpp.git branch "queue-shutdown" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Jun 6 16:49:56 CDT 2011


branch "queue-shutdown" has been updated
       via  6da01131aef4cb6b009514adbd3acfefcbcfd5a7 (commit)
      from  d813bbcb95b2151ea23404268e18d2fcb891fd20 (commit)

Summary of changes:
 src/WorkQueue/DefaultQueueListener.cpp      |    9 +++++++++
 test/WorkQueue/TestSuspendableWorkQueue.cpp |    8 ++++----
 test/WorkQueue/TestWorkQueue.cpp            |    8 ++++----
 3 files changed, 17 insertions(+), 8 deletions(-)


- Log -----------------------------------------------------------------
commit 6da01131aef4cb6b009514adbd3acfefcbcfd5a7
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Jun 6 16:48:55 2011 -0500

    Add appropriate changes based on changes to QueueListener

diff --git a/src/WorkQueue/DefaultQueueListener.cpp b/src/WorkQueue/DefaultQueueListener.cpp
index 82490b3..f191c17 100644
--- a/src/WorkQueue/DefaultQueueListener.cpp
+++ b/src/WorkQueue/DefaultQueueListener.cpp
@@ -90,6 +90,15 @@ public:
 DefaultQueueListener::DefaultQueueListener(const QueueBasePtr& queue)
     : mPriv(new DefaultQueueListenerPriv(queue)) { }
 
+DefaultQueueListener::~DefaultQueueListener()
+{
+    if (!mPriv->mIsShutdown)
+    {
+        mPriv->setDead(true);
+        mPriv->mThread.join();
+    }
+}
+
 void DefaultQueueListener::workAdded(const QueueBasePtr&, Ice::Long, bool wasEmpty)
 {
     if (wasEmpty)
diff --git a/test/WorkQueue/TestSuspendableWorkQueue.cpp b/test/WorkQueue/TestSuspendableWorkQueue.cpp
index 176b48f..5cf376c 100644
--- a/test/WorkQueue/TestSuspendableWorkQueue.cpp
+++ b/test/WorkQueue/TestSuspendableWorkQueue.cpp
@@ -32,25 +32,25 @@ public:
         resumableNotice(false),
         shutdownNotice(false) { }
 
-    void workAdded(Ice::Long, bool wasEmpty)
+    void workAdded(const QueueBasePtr&, Ice::Long, bool wasEmpty)
     {
         addedNotice = true;
         addedEmptyNotice = wasEmpty;
     }
 
-    void emptied()
+    void emptied(const QueueBasePtr&)
     {
         emptyNotice = true;
     }
 
-    void workResumable()
+    void workResumable(const QueueBasePtr&)
     {
         boost::unique_lock<boost::mutex> lock(mLock);
         resumableNotice = true;
         mCond.notify_one();
     }
 
-    void shuttingDown()
+    void shuttingDown(const QueueBasePtr&)
     {
         shutdownNotice = true;
     }
diff --git a/test/WorkQueue/TestWorkQueue.cpp b/test/WorkQueue/TestWorkQueue.cpp
index 3f60bb4..79f357d 100644
--- a/test/WorkQueue/TestWorkQueue.cpp
+++ b/test/WorkQueue/TestWorkQueue.cpp
@@ -31,24 +31,24 @@ public:
         addedEmptyNotice(false),
         emptyNotice(false), shutdownNotice(false) { }
 
-    void workAdded(Ice::Long numNewWork, bool wasEmpty)
+    void workAdded(const QueueBasePtr&, Ice::Long numNewWork, bool wasEmpty)
     {
         addedNotice = true;
         addedEmptyNotice = wasEmpty;
         tasksAdded = numNewWork;
     }
 
-    void emptied()
+    void emptied(const QueueBasePtr&)
     {
         emptyNotice = true;
     }
 
-    void workResumable()
+    void workResumable(const QueueBasePtr&)
     {
         BOOST_FAIL("workResumable called from a Queue?!");
     }
     
-    void shuttingDown()
+    void shuttingDown(const QueueBasePtr&)
     {
         shutdownNotice = true;
     }

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/ice-util-cpp.git



More information about the asterisk-scf-commits mailing list