THRIFT-351. cpp: Allow a custom ThreadFactory in TThreadedServer
authorDavid Reiss <dreiss@apache.org>
Sat, 14 Mar 2009 23:35:16 +0000 (23:35 +0000)
committerDavid Reiss <dreiss@apache.org>
Sat, 14 Mar 2009 23:35:16 +0000 (23:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@754551 13f79535-47bb-0310-9956-ffa450edef68

lib/cpp/src/server/TThreadedServer.cpp
lib/cpp/src/server/TThreadedServer.h

index 4840b7f..3620d97 100644 (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() {
index 8294f69..7ff07d9 100644 (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();