MCPcopy Create free account
hub / github.com/catboost/catboost / MakeThreadPool

Method MakeThreadPool

library/cpp/http/server/http.cpp:505–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503private:
504 template <class TThreadPool_>
505 static THolder<IThreadPool> MakeThreadPool(IThreadFactory* factory, bool elastic, ICallBack* callback = nullptr, const TString& threadName = {}) {
506 if (!factory) {
507 factory = SystemThreadFactory();
508 }
509
510 THolder<IThreadPool> pool;
511 const auto params = IThreadPool::TParams().SetFactory(factory).SetThreadName(threadName);
512 if (callback) {
513 pool = MakeHolder<TThreadPoolBinder<TThreadPool_, THttpServer::ICallBack>>(callback, params);
514 } else {
515 pool = MakeHolder<TThreadPool_>(params);
516 }
517
518 if (elastic) {
519 pool = MakeHolder<TElasticQueue>(std::move(pool));
520 }
521
522 return pool;
523 }
524};
525
526THttpServer::THttpServer(ICallBack* cb, const TOptions& options, IThreadFactory* pool)

Callers

nothing calls this directly

Calls 4

SystemThreadFactoryFunction · 0.85
SetFactoryMethod · 0.80
TParamsClass · 0.50
moveFunction · 0.50

Tested by

no test coverage detected