Add ThreadPoolSocketObserver::get_thread_info
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 1 Jun 2012 09:13:39 +0000 (11:13 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 1 Jun 2012 09:13:39 +0000 (11:13 +0200)
src/thread_pool_observer.cpp
src/thread_pool_observer.hpp

index ce37235..e9dd20c 100644 (file)
@@ -166,6 +166,12 @@ void ThreadPoolSocketObserver::socketNotify(int event)
     }
 }
 
+void ThreadPoolSocketObserver::get_thread_info(int &tbusy, int &total)
+{
+    tbusy = m_p->m_no_threads - m_p->m_no_threads_waiting;
+    total = m_p->m_no_threads;
+}
+
 void ThreadPoolSocketObserver::run(void *p)
 {
     while(1)
index 73ee78f..4fe5fd3 100644 (file)
@@ -44,6 +44,7 @@ namespace metaproxy_1 {
         void cleanup(IThreadPoolMsg *m, void *info);
         IThreadPoolMsg *get();
         void run(void *p);
+        void get_thread_info(int &tbusy, int &total);
     private:
         void socketNotify(int event);
         boost::scoped_ptr<Rep> m_p;