From 2a15a6c679aaeb2c710c09b8cf945d1284f5f4fb Mon Sep 17 00:00:00 2001 From: Dave Watson Date: Mon, 24 Nov 2014 12:36:30 -0800 Subject: [PATCH] set internal thread factory Summary: Fix up a TODO Test Plan: ?? Should I bother with a test? Reviewed By: jsedgwick@fb.com Subscribers: doug, fugalh, njormrod, folly-diffs@ FB internal diff: D1710633 Signature: t1:1710633:1417469890:9e8513140bae79da384c9d5418d4ea0840efbe6c --- folly/experimental/wangle/bootstrap/ServerBootstrap.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/folly/experimental/wangle/bootstrap/ServerBootstrap.h b/folly/experimental/wangle/bootstrap/ServerBootstrap.h index 8f29cb52..4d55c4e3 100644 --- a/folly/experimental/wangle/bootstrap/ServerBootstrap.h +++ b/folly/experimental/wangle/bootstrap/ServerBootstrap.h @@ -102,9 +102,11 @@ class ServerBootstrap { io_group = std::make_shared( 32, std::make_shared("IO Thread")); } - auto factory = io_group->getThreadFactory(); - - //CHECK(factory == nullptr); // TODO + auto factoryBase = io_group->getThreadFactory(); + CHECK(factoryBase); + auto factory = std::dynamic_pointer_cast( + factoryBase); + CHECK(factory); // Must be named thread factory CHECK(acceptorFactory_ || pipelineFactory_); @@ -115,6 +117,7 @@ class ServerBootstrap { workerFactory_ = std::make_shared( std::make_shared>(pipelineFactory_)); } + workerFactory_->setInternalFactory(factory); acceptor_group_ = accept_group; io_group_ = io_group; -- 2.34.1