the default pool thread number is thread hw concurrency

This commit is contained in:
Jinhao
2018-08-25 06:53:11 +08:00
parent e0ba1c7d8a
commit e8e7ad543c
3 changed files with 20 additions and 11 deletions

View File

@@ -2086,7 +2086,7 @@ namespace nana{ namespace widgets
void text_editor::copy() const
{
//Stops copying text if the text_editor is masked.
//Disallows copying text if the text_editor is masked.
if (mask_char_)
return;

View File

@@ -351,10 +351,17 @@ namespace threads
}container_;
};//end class impl
pool::pool()
: impl_(new impl(4))
#ifndef STD_THREAD_NOT_SUPPORTED
pool::pool(unsigned thread_number)
: impl_(new impl(thread_number ? thread_number : std::thread::hardware_concurrency()))
{
}
#else
pool::pool(unsigned thread_number)
: impl_(new impl(0))
{
}
#endif
pool::pool(pool&& other)
: pool()
@@ -362,11 +369,6 @@ namespace threads
std::swap(impl_, other.impl_);
}
pool::pool(std::size_t thread_number)
: impl_(new impl(thread_number))
{
}
pool& pool::operator=(pool&& other)
{
if(this != &other)