Skip to content
Snippets Groups Projects
Commit a4ab5521 authored by Danilo Piparo's avatar Danilo Piparo
Browse files

Add move assignment and ctor to TTaskGroup, delete copy ctor

parent 2e8d0d91
No related branches found
No related tags found
Loading
......@@ -44,6 +44,9 @@ private:
public:
TTaskGroup();
TTaskGroup( TTaskGroup&& other );
TTaskGroup(const TTaskGroup& ) = delete;
TTaskGroup& operator=( TTaskGroup&& other );
~TTaskGroup();
void Run(const std::function<void(void)> &closure);
......
......@@ -42,8 +42,20 @@ TTaskGroup::TTaskGroup()
fTaskContainer = ((TaskContainerPtr_t *)new tbb::task_group());
}
TTaskGroup::TTaskGroup( TTaskGroup&& other ) {
*this = std::move(other);
}
TTaskGroup& TTaskGroup::operator=( TTaskGroup&& other ) {
fTaskContainer = other.fTaskContainer;
other.fTaskContainer = nullptr;
fCanRun.store(other.fCanRun);
return *this;
}
TTaskGroup::~TTaskGroup()
{
if (!fTaskContainer) return;
Wait();
delete ((tbb::task_group *)fTaskContainer);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment