From: Adam Dickmeiss Date: Fri, 1 Jun 2012 09:13:39 +0000 (+0200) Subject: Add ThreadPoolSocketObserver::get_thread_info X-Git-Tag: v1.3.37~4 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=5ea0250959340c9cde8603e99c8f967eadf1990f;p=metaproxy-moved-to-github.git Add ThreadPoolSocketObserver::get_thread_info --- diff --git a/src/thread_pool_observer.cpp b/src/thread_pool_observer.cpp index ce37235..e9dd20c 100644 --- a/src/thread_pool_observer.cpp +++ b/src/thread_pool_observer.cpp @@ -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) diff --git a/src/thread_pool_observer.hpp b/src/thread_pool_observer.hpp index 73ee78f..4fe5fd3 100644 --- a/src/thread_pool_observer.hpp +++ b/src/thread_pool_observer.hpp @@ -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 m_p;