fix the revertable lock of window_manager

This commit is contained in:
Jinhao
2016-10-19 02:58:49 +08:00
parent 01ff1c11c1
commit 9ed5e81ca2
6 changed files with 53 additions and 23 deletions

View File

@@ -356,11 +356,28 @@ namespace threads
{
}
pool::pool(pool&& other)
: pool()
{
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)
{
delete impl_;
impl_ = other.impl_;
other.impl_ = new impl(4);
}
return *this;
}
pool::~pool()
{
delete impl_;