Core/SOAP: Remove redundant thread pool of a hard coded 5 amount of threads that would just linger. Not really smart design to have a single SOAP thread -> SOAP thread pool -> single world thread handling CLI commands.
Thanks to leak for spotting the leak.
This commit is contained in:
@@ -19,14 +19,8 @@
|
|||||||
#include "soapH.h"
|
#include "soapH.h"
|
||||||
#include "soapStub.h"
|
#include "soapStub.h"
|
||||||
|
|
||||||
#define POOL_SIZE 5
|
|
||||||
|
|
||||||
void TCSoapRunnable::run()
|
void TCSoapRunnable::run()
|
||||||
{
|
{
|
||||||
// create pool
|
|
||||||
SOAPWorkingThread pool;
|
|
||||||
pool.activate (THR_NEW_LWP | THR_JOINABLE, POOL_SIZE);
|
|
||||||
|
|
||||||
struct soap soap;
|
struct soap soap;
|
||||||
soap_init(&soap);
|
soap_init(&soap);
|
||||||
soap_set_imode(&soap, SOAP_C_UTFSTRING);
|
soap_set_imode(&soap, SOAP_C_UTFSTRING);
|
||||||
@@ -54,16 +48,13 @@ void TCSoapRunnable::run()
|
|||||||
|
|
||||||
ACE_Message_Block *mb = new ACE_Message_Block(sizeof(struct soap*));
|
ACE_Message_Block *mb = new ACE_Message_Block(sizeof(struct soap*));
|
||||||
ACE_OS::memcpy(mb->wr_ptr(), &thread_soap, sizeof(struct soap*));
|
ACE_OS::memcpy(mb->wr_ptr(), &thread_soap, sizeof(struct soap*));
|
||||||
pool.putq(mb);
|
process_message(mb);
|
||||||
}
|
}
|
||||||
|
|
||||||
pool.msg_queue()->deactivate();
|
|
||||||
pool.wait();
|
|
||||||
|
|
||||||
soap_done(&soap);
|
soap_done(&soap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SOAPWorkingThread::process_message (ACE_Message_Block *mb)
|
void TCSoapRunnable::process_message(ACE_Message_Block *mb)
|
||||||
{
|
{
|
||||||
ACE_TRACE (ACE_TEXT ("SOAPWorkingThread::process_message"));
|
ACE_TRACE (ACE_TEXT ("SOAPWorkingThread::process_message"));
|
||||||
|
|
||||||
|
|||||||
@@ -41,37 +41,12 @@ class TCSoapRunnable: public ACE_Based::Runnable
|
|||||||
m_port = port;
|
m_port = port;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
void process_message(ACE_Message_Block *mb);
|
||||||
|
|
||||||
std::string m_host;
|
std::string m_host;
|
||||||
uint16 m_port;
|
uint16 m_port;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SOAPWorkingThread : public ACE_Task<ACE_MT_SYNCH>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SOAPWorkingThread() { }
|
|
||||||
|
|
||||||
virtual int svc(void)
|
|
||||||
{
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
ACE_Message_Block *mb = 0;
|
|
||||||
if (this->getq(mb) == -1)
|
|
||||||
{
|
|
||||||
ACE_DEBUG((LM_INFO,
|
|
||||||
ACE_TEXT("(%t) Shutting down\n")));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Process the message.
|
|
||||||
process_message(mb);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
void process_message(ACE_Message_Block *mb);
|
|
||||||
};
|
|
||||||
|
|
||||||
class SOAPCommand
|
class SOAPCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user