THRIFT-351. cpp: Allow a custom ThreadFactory in TThreadedServer

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@754551 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Reiss 2009-03-14 23:35:16 +00:00
parent e0a11c44ab
commit 45d56965c2
2 changed files with 16 additions and 0 deletions

View File

@ -106,6 +106,16 @@ TThreadedServer::TThreadedServer(shared_ptr<TProcessor> processor,
threadFactory_ = shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
}
TThreadedServer::TThreadedServer(boost::shared_ptr<TProcessor> processor,
boost::shared_ptr<TServerTransport> serverTransport,
boost::shared_ptr<TTransportFactory> transportFactory,
boost::shared_ptr<TProtocolFactory> protocolFactory,
boost::shared_ptr<ThreadFactory> threadFactory):
TServer(processor, serverTransport, transportFactory, protocolFactory),
threadFactory_(threadFactory),
stop_(false) {
}
TThreadedServer::~TThreadedServer() {}
void TThreadedServer::serve() {

View File

@ -32,6 +32,12 @@ class TThreadedServer : public TServer {
boost::shared_ptr<TTransportFactory> transportFactory,
boost::shared_ptr<TProtocolFactory> protocolFactory);
TThreadedServer(boost::shared_ptr<TProcessor> processor,
boost::shared_ptr<TServerTransport> serverTransport,
boost::shared_ptr<TTransportFactory> transportFactory,
boost::shared_ptr<TProtocolFactory> protocolFactory,
boost::shared_ptr<ThreadFactory> threadFactory);
virtual ~TThreadedServer();
virtual void serve();