Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / Bug_1361_Regression / Server_Thread_Pool.h
blobbcd01b5a604b652f77696daf25ddb8e4f17c78b1
1 #include "ace/Task_T.h"
2 #include "ace/Service_Config.h"
4 #include "TestC.h"
6 class Thread_Pool : public ACE_Task<ACE_SYNCH>
8 // = TITLE
9 // Defines a thread pool abstraction based on the <ACE_Task>.
10 public:
11 Thread_Pool (CORBA::ORB_ptr orb,
12 ACE_Thread_Manager *thr_mgr,
13 int n_threads);
14 // Constructor activates <n_threads> in the thread pool.
16 virtual ~Thread_Pool ();
17 // Destructor...
18 int shutdown ();
20 virtual int svc ();
22 virtual int put (Test::Echo_ptr echoptr);
24 virtual int put (ACE_Message_Block *mb,
25 ACE_Time_Value *tv = 0);
26 // This allows the producer to pass messages to the <Thread_Pool>.
28 private:
29 virtual int close (u_long);
30 // Close hook.
31 CORBA::ORB_var orb_;
32 ACE_Atomic_Op<TAO_SYNCH_MUTEX, int> nt_; // number of threads