[asterisk-scf-commits] asterisk-scf/release/ice-util-cpp.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon May 23 16:16:00 CDT 2011


branch "master" has been updated
       via  270fd2ef3b8309ac10c022e605b3b7651810c1d9 (commit)
       via  9967956f986882c50ccba778a3f277eb782ab421 (commit)
      from  c857c099bf0825ee10e637b0ba5a6860ba0289d2 (commit)

Summary of changes:
 include/AsteriskSCF/ThreadPool/WorkerThread.h |    8 ++++++++
 src/ThreadPool/ThreadPool.cpp                 |   10 ++++++++++
 src/ThreadPool/WorkerThread.cpp               |    2 ++
 3 files changed, 20 insertions(+), 0 deletions(-)


- Log -----------------------------------------------------------------
commit 270fd2ef3b8309ac10c022e605b3b7651810c1d9
Merge: 9967956 c857c09
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon May 23 16:09:06 2011 -0500

    Merge branch 'master' of git.asterisk.org:asterisk-scf/release/ice-util-cpp


commit 9967956f986882c50ccba778a3f277eb782ab421
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu May 19 19:03:09 2011 -0500

    Implement new threadStart and threadStop calls.

diff --git a/include/AsteriskSCF/ThreadPool/WorkerThread.h b/include/AsteriskSCF/ThreadPool/WorkerThread.h
index 4597a11..6bf1a4d 100644
--- a/include/AsteriskSCF/ThreadPool/WorkerThread.h
+++ b/include/AsteriskSCF/ThreadPool/WorkerThread.h
@@ -84,6 +84,14 @@ public:
      * A zombie thread has died
      */
     virtual void zombieThreadDead(WorkerThreadPtr thread) = 0;
+    /**
+     * A new thread has been created
+     */
+    virtual void threadStarted() = 0;
+    /**
+     * A thread has finished its execution
+     */
+    virtual void threadFinished() = 0;
 };
 
 }; // end namespace ThreadPool
diff --git a/src/ThreadPool/ThreadPool.cpp b/src/ThreadPool/ThreadPool.cpp
index fb7e601..ac9aff3 100644
--- a/src/ThreadPool/ThreadPool.cpp
+++ b/src/ThreadPool/ThreadPool.cpp
@@ -196,6 +196,16 @@ public:
         }
     }
 
+    void threadStarted()
+    {
+        mListener->threadStart();
+    }
+
+    void threadFinished()
+    {
+        mListener->threadStop();
+    }
+
     /**
      * Queued task that causes the thread pool to gain or lose threads
      *
diff --git a/src/ThreadPool/WorkerThread.cpp b/src/ThreadPool/WorkerThread.cpp
index 6f8b59f..d8a68b8 100644
--- a/src/ThreadPool/WorkerThread.cpp
+++ b/src/ThreadPool/WorkerThread.cpp
@@ -37,6 +37,7 @@ public:
 
     void active()
     {
+        mListener->threadStarted();
         /**
          * For all intents and purposes, localAlive
          * should evaluate to (mState == Alive). We use
@@ -64,6 +65,7 @@ public:
         {
             mListener->zombieThreadDead(mWorkerThread);
         }
+        mListener->threadFinished();
     }
 
     bool idle()

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


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



More information about the asterisk-scf-commits mailing list