1 #include "ace/Message_Block.h"
7 #include "jaws3/Concurrency.h"
8 #include "jaws3/TPR_Concurrency.h"
9 #include "jaws3/Protocol_Handler.h"
10 #include "jaws3/Options.h"
13 JAWS_TPR_Concurrency::JAWS_TPR_Concurrency ()
19 r
= this->activate (THR_BOUND
| THR_JOINABLE
);
23 this->shutdown_task_
= 1;
28 JAWS_TPR_Concurrency::putq (JAWS_Protocol_Handler
*ph
)
33 JAWS_CONCURRENCY_TASK
*task
= this;
34 int result
= task
->putq (& ph
->mb_
);
39 r
= this->activate ( THR_BOUND
| THR_JOINABLE
40 , 1 // number of threads
54 JAWS_TPR_Concurrency::getq (JAWS_Protocol_Handler
*&ph
)
58 JAWS_CONCURRENCY_TASK
*task
= this;
60 if (this->shutdown_task_
&& task
->msg_queue ()->message_count () == 0)
63 int getting
= ++(this->getting_
);
65 if (getting
> 1 && task
->msg_queue ()->message_count () == 0)
71 ACE_Message_Block
*mb
= 0;
72 int result
= task
->getq (mb
);
76 ph
= (JAWS_Protocol_Handler
*) mb
->base ();
80 // Shutdown this task;
81 this->shutdown_task_
= 1;