Fix a error in setThreadNum method (#263)

This commit is contained in:
An Tao 2019-10-01 01:40:22 +08:00 committed by GitHub
parent 56b9a320b5
commit 5605d7d351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -225,7 +225,11 @@ void HttpAppFrameworkImpl::registerHttpController(
} }
HttpAppFramework &HttpAppFrameworkImpl::setThreadNum(size_t threadNum) HttpAppFramework &HttpAppFrameworkImpl::setThreadNum(size_t threadNum)
{ {
assert(threadNum >= 1); if (threadNum == 0)
{
_threadNum = std::thread::hardware_concurrency();
return *this;
}
_threadNum = threadNum; _threadNum = threadNum;
return *this; return *this;
} }