summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-03-15 17:39:05 -0400
committerDavid Robillard <d@drobilla.net>2018-03-15 17:39:05 -0400
commitcc110c047e20499d995dac9bcbb1e9d15bbae4c2 (patch)
tree01654590d3e11040ad56a4239df264dbf2256b61 /src/server
parenta390f6065fb14a9768f3b1693adf9586870945cd (diff)
downloadingen-cc110c047e20499d995dac9bcbb1e9d15bbae4c2.tar.gz
ingen-cc110c047e20499d995dac9bcbb1e9d15bbae4c2.tar.bz2
ingen-cc110c047e20499d995dac9bcbb1e9d15bbae4c2.zip
Simplify Task
Diffstat (limited to 'src/server')
-rw-r--r--src/server/Task.hpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/server/Task.hpp b/src/server/Task.hpp
index 22f72997..99fe347d 100644
--- a/src/server/Task.hpp
+++ b/src/server/Task.hpp
@@ -46,37 +46,18 @@ public:
, _done(false)
{
assert(block);
+ assert(!(_mode == Mode::SINGLE && !_block));
}
- Task(Mode mode, BlockImpl* block = nullptr)
- : _block(block)
+ Task(Mode mode)
+ : _block(nullptr)
, _mode(mode)
, _done_end(0)
, _next(0)
, _done(false)
{
- assert(!(mode == Mode::SINGLE && !block));
- }
-
- Task(Task&& task)
- : _children(std::move(task._children))
- , _block(task._block)
- , _mode(task._mode)
- , _done_end(task._done_end)
- , _next(task._next.load())
- , _done(task._done.load())
- {}
-
- Task& operator=(Task&& task)
- {
- _children = std::move(task._children);
- _block = task._block;
- _mode = task._mode;
- _done_end = task._done_end;
- _next = task._next.load();
- _done = task._done.load();
- return *this;
+ assert(!(_mode == Mode::SINGLE && !_block));
}
/** Run task in the given context. */
@@ -100,11 +81,6 @@ public:
}
/** Prepend a child to this task. */
- void push_front(Task&& task) {
- _children.emplace_front(std::unique_ptr<Task>(new Task(std::move(task))));
- }
-
- /** Prepend a child to this task. */
template<typename... Args>
void emplace_front(Args... args) {
_children.emplace_front(std::unique_ptr<Task>(new Task(std::forward<Args>(args)...)));