Update ThreadPool.cpp

This commit is contained in:
Nikita Mikhaylov 2021-05-25 15:58:04 +03:00 committed by GitHub
parent ba6595cd17
commit da496cba01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,7 +114,7 @@ ReturnType ThreadPoolImpl<Thread>::scheduleImpl(Job job, int priority, std::opti
return on_error(); return on_error();
/// We must not to allocate any memory after we emplaced a job in a queue. /// We must not to allocate any memory after we emplaced a job in a queue.
/// Bacause if an exception would be thrown, we won't notify a thread about job occurrence. /// Because if an exception would be thrown, we won't notify a thread about job occurrence.
/// Check if there are enough threads to process job. /// Check if there are enough threads to process job.
if (threads.size() < std::min(max_threads, scheduled_jobs + 1)) if (threads.size() < std::min(max_threads, scheduled_jobs + 1))