[asterisk-scf-commits] asterisk-scf/integration/ice-util-cpp.git branch "workqueue" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Apr 6 11:11:15 CDT 2011
branch "workqueue" has been updated
via 86abba83aaa0ab18fcf39fb9de17064f5bdce030 (commit)
from bcab7364effa06658e074cdc729ca444ecf9d7e1 (commit)
Summary of changes:
ThreadPool/CMakeLists.txt | 1 +
ThreadPool/include/AsteriskSCF/ThreadPool.h | 2 +-
ThreadPool/src/ThreadPool.cpp | 4 ++--
ThreadPool/test/CMakeLists.txt | 4 ++++
ThreadPool/test/TestThreadPool.cpp | 5 ++++-
5 files changed, 12 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 86abba83aaa0ab18fcf39fb9de17064f5bdce030
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Apr 6 11:09:14 2011 -0500
Everything is actually compiling and linking properly. I am happy.
The only test written so far passed, too. COOL.
diff --git a/ThreadPool/CMakeLists.txt b/ThreadPool/CMakeLists.txt
index 5e888f0..b1a0931 100644
--- a/ThreadPool/CMakeLists.txt
+++ b/ThreadPool/CMakeLists.txt
@@ -7,3 +7,4 @@
#
add_subdirectory(src)
+add_subdirectory(test)
diff --git a/ThreadPool/include/AsteriskSCF/ThreadPool.h b/ThreadPool/include/AsteriskSCF/ThreadPool.h
index 70fad04..292c993 100644
--- a/ThreadPool/include/AsteriskSCF/ThreadPool.h
+++ b/ThreadPool/include/AsteriskSCF/ThreadPool.h
@@ -27,7 +27,7 @@ namespace ThreadPool
class ThreadPoolPriv;
-class ThreadPool : public AsteriskSCF::System::ThreadPool::V1::Pool, public AsteriskSCF::System::WorkQueue::V1::QueueListener
+class ThreadPool : public AsteriskSCF::System::ThreadPool::V1::Pool
{
public:
ThreadPool(const AsteriskSCF::System::ThreadPool::V1::PoolListenerPtr& listener, const AsteriskSCF::System::WorkQueue::V1::QueuePtr& queue);
diff --git a/ThreadPool/src/ThreadPool.cpp b/ThreadPool/src/ThreadPool.cpp
index 22bdcaf..5babc9f 100644
--- a/ThreadPool/src/ThreadPool.cpp
+++ b/ThreadPool/src/ThreadPool.cpp
@@ -99,7 +99,7 @@ public:
mQueue->setListener(new ThreadQueueListener(boost::shared_ptr<ThreadPoolPriv> (this), mPool));
}
- void activeThreadIdle(const boost::shared_ptr<WorkerThread> &thread)
+ void activeThreadIdle(const boost::shared_ptr<WorkerThread>& thread)
{
int activeSize;
int idleSize;
@@ -121,7 +121,7 @@ public:
mListener->stateChanged(mPool, activeSize, idleSize, zombieSize);
}
- void zombieThreadDead(const boost::shared_ptr<WorkerThread> &thread)
+ void zombieThreadDead(const boost::shared_ptr<WorkerThread>& thread)
{
int activeSize;
int idleSize;
diff --git a/ThreadPool/test/CMakeLists.txt b/ThreadPool/test/CMakeLists.txt
index 78678df..c7a2dd0 100644
--- a/ThreadPool/test/CMakeLists.txt
+++ b/ThreadPool/test/CMakeLists.txt
@@ -10,8 +10,11 @@ asterisk_scf_component_init(ThreadPoolTest CXX)
include_directories(${API_INCLUDE_DIR})
include_directories(../src)
+# The test requires a work queue
+include_directories(../../WorkQueue/include)
include_directories(../include)
+
asterisk_scf_component_add_file(ThreadPoolTest TestThreadPool.cpp)
asterisk_scf_component_add_file(ThreadPoolTest test.cpp)
asterisk_scf_component_add_boost_libraries(ThreadPoolTest unit_test_framework)
@@ -19,5 +22,6 @@ asterisk_scf_component_add_boost_libraries(ThreadPoolTest unit_test_framework)
asterisk_scf_component_build_standalone(ThreadPoolTest)
target_link_libraries(ThreadPoolTest asterisk-scf-api)
target_link_libraries(ThreadPoolTest ThreadPool)
+target_link_libraries(ThreadPoolTest WorkQueue)
boost_add_test(ThreadPoolTest)
diff --git a/ThreadPool/test/TestThreadPool.cpp b/ThreadPool/test/TestThreadPool.cpp
index dcf06e5..d6e6c54 100644
--- a/ThreadPool/test/TestThreadPool.cpp
+++ b/ThreadPool/test/TestThreadPool.cpp
@@ -15,8 +15,11 @@
*/
#include <boost/test/unit_test.hpp>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/mutex.hpp>
#include <AsteriskSCF/WorkQueue.h>
+#include <AsteriskSCF/ThreadPool.h>
using namespace AsteriskSCF::System::ThreadPool::V1;
using namespace AsteriskSCF::ThreadPool;
@@ -86,7 +89,7 @@ BOOST_AUTO_TEST_CASE(addWork)
TestListenerPtr listener(new TestListener);
QueuePtr queue(new WorkQueue());
SimpleTaskPtr work(new SimpleTask());
- PoolPtr Pool(new ThreadPool(listener, queue));
+ PoolPtr pool(new ThreadPool(listener, queue));
queue->enqueueWork(work);
-----------------------------------------------------------------------
--
asterisk-scf/integration/ice-util-cpp.git
More information about the asterisk-scf-commits
mailing list