1 #include "JAWS_Concurrency.h"
3 JAWS_Concurrency_Base::JAWS_Concurrency_Base ()
8 JAWS_Concurrency_Base::put (ACE_Message_Block
*mb
, ACE_Time_Value
*tv
)
10 return this->putq (mb
, tv
);
14 JAWS_Concurrency_Base::svc ()
20 ACE_Message_Block
*mb
= 0;
22 // At this point we could set a timeout value so that the
23 // threading strategy can delete a thread if there is nothing to
24 // do. Carefully think how to implement it so you don't leave
25 // yourself with 0 threads.
27 result
= this->getq (mb
);
28 if (result
== -1 || mb
== 0)
36 JAWS_Dispatch_Policy::JAWS_Dispatch_Policy ()
40 JAWS_Dispatch_Policy::~JAWS_Dispatch_Policy ()
44 JAWS_Dispatcher::JAWS_Dispatcher (JAWS_Dispatch_Policy
*policy
)
49 JAWS_Thread_Pool_Task::JAWS_Thread_Pool_Task (long flags
,
52 : nthreads_ (nthreads
),
53 maxthreads_ (maxthreads
)
55 if (this->activate (flags
, nthreads
) == -1)
56 ACE_ERROR ((LM_ERROR
, "%p\n", "JAWS_Thread_Pool_Task::activate"));
59 JAWS_Thread_Per_Task::JAWS_Thread_Per_Task (long flags
, int maxthreads
)
61 maxthreads_ (maxthreads
)
66 JAWS_Thread_Per_Task::put (ACE_Message_Block
*mb
, ACE_Time_Value
*tv
)
68 const int force_active
= 1;
69 const int nthreads
= 1;
71 if (this->activate (this->flags_
, nthreads
, force_active
) == -1)
72 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", "JAWS_Thread_Pool_Task::activate"),