From 6d8d16b3761eaa24c9c754dd0f2cc1a70de8fad0 Mon Sep 17 00:00:00 2001 From: Dwayne Boone Date: Fri, 2 Oct 2009 09:35:28 -0230 Subject: C++Builder 2010 support --- cpp/src/Ice/ThreadPool.h | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'cpp/src/Ice/ThreadPool.h') 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 #include #include -#include +#include #include #include #include +#include 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 _workItems; +}; + // // The ThreadPoolMessage class below hides the IOCP implementation details from // the event handler implementations. Only event handler implementation that -- cgit v1.2.3