diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-10-02 09:35:28 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-10-02 09:35:28 -0230 |
commit | 6d8d16b3761eaa24c9c754dd0f2cc1a70de8fad0 (patch) | |
tree | ff37056717cff166bc705112f54e98074f8d1f40 /cpp/src/Ice/ThreadPool.h | |
parent | 3772. Recovering from Glacier2 / Ice router session failure. (diff) | |
download | ice-6d8d16b3761eaa24c9c754dd0f2cc1a70de8fad0.tar.bz2 ice-6d8d16b3761eaa24c9c754dd0f2cc1a70de8fad0.tar.xz ice-6d8d16b3761eaa24c9c754dd0f2cc1a70de8fad0.zip |
C++Builder 2010 support
Diffstat (limited to 'cpp/src/Ice/ThreadPool.h')
-rw-r--r-- | cpp/src/Ice/ThreadPool.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/cpp/src/Ice/ThreadPool.h b/cpp/src/Ice/ThreadPool.h index 51d4eb55af9..9b7863643e2 100644 --- a/cpp/src/Ice/ThreadPool.h +++ b/cpp/src/Ice/ThreadPool.h @@ -20,11 +20,12 @@ #include <Ice/InstanceF.h> #include <Ice/LoggerF.h> #include <Ice/PropertiesF.h> -#include <Ice/EventHandlerF.h> +#include <Ice/EventHandler.h> #include <Ice/Selector.h> #include <Ice/BasicStream.h> #include <set> +#include <list> namespace IceInternal { @@ -161,6 +162,42 @@ public: virtual void execute(ThreadPoolCurrent&) = 0; }; +class ThreadPoolWorkQueue : public EventHandler, public IceUtil::Mutex +{ +public: + + ThreadPoolWorkQueue(ThreadPool*, const InstancePtr&, Selector&); + ~ThreadPoolWorkQueue(); + + void destroy(); + void queue(const ThreadPoolWorkItemPtr&); + +#ifdef ICE_USE_IOCP + bool startAsync(SocketOperation); + bool finishAsync(SocketOperation); +#endif + + virtual void message(ThreadPoolCurrent&); + virtual void finished(ThreadPoolCurrent&); + virtual std::string toString() const; + virtual NativeInfoPtr getNativeInfo(); + virtual void postMessage(); + +private: + + const ThreadPool* _threadPool; + const InstancePtr _instance; + Selector& _selector; + bool _destroyed; +#ifdef ICE_USE_IOCP + AsyncInfo _info; +#else + SOCKET _fdIntrRead; + SOCKET _fdIntrWrite; +#endif + std::list<ThreadPoolWorkItemPtr> _workItems; +}; + // // The ThreadPoolMessage class below hides the IOCP implementation details from // the event handler implementations. Only event handler implementation that |