From 5ea0250959340c9cde8603e99c8f967eadf1990f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 1 Jun 2012 11:13:39 +0200 Subject: [PATCH] Add ThreadPoolSocketObserver::get_thread_info --- src/thread_pool_observer.cpp | 6 ++++++ src/thread_pool_observer.hpp | 1 + 2 files changed, 7 insertions(+) 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; -- 1.7.10.4