X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fthread_pool_observer.hpp;h=8d59897322bf4f5d283fd0e2b330f068d7327974;hb=ed1d79c860c13fb92e5b7eea8de2cd608a6caa0e;hp=52f3d791068279d8a24351d1d48ed9e66fe3d872;hpb=50597d2f7d3607e91c94601eb8eb495d73be3eae;p=metaproxy-moved-to-github.git diff --git a/src/thread_pool_observer.hpp b/src/thread_pool_observer.hpp index 52f3d79..8d59897 100644 --- a/src/thread_pool_observer.hpp +++ b/src/thread_pool_observer.hpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2012 Index Data + Copyright (C) Index Data Metaproxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -28,8 +28,9 @@ namespace metaproxy_1 { class IThreadPoolMsg { public: virtual IThreadPoolMsg *handle() = 0; - virtual void result() = 0; + virtual void result(const char *info) = 0; virtual ~IThreadPoolMsg(); + virtual bool cleanup(void *info) = 0; }; class ThreadPoolSocketObserver : public yazpp_1::ISocketObserver { @@ -37,11 +38,14 @@ namespace metaproxy_1 { class Worker; public: ThreadPoolSocketObserver(yazpp_1::ISocketObservable *obs, - int no_threads); + unsigned min_threads, unsigned max_threads, + unsigned stack_size); virtual ~ThreadPoolSocketObserver(); void put(IThreadPoolMsg *m); + 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;