summaryrefslogtreecommitdiffstats
path: root/src/server/RunContext.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/RunContext.hpp')
-rw-r--r--src/server/RunContext.hpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/server/RunContext.hpp b/src/server/RunContext.hpp
index bb64a250..6c8246ca 100644
--- a/src/server/RunContext.hpp
+++ b/src/server/RunContext.hpp
@@ -20,6 +20,8 @@
#include <cstdint>
#include <thread>
+#include <boost/variant/variant.hpp>
+
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "raul/RingBuffer.hpp"
@@ -30,7 +32,12 @@ namespace Server {
class Engine;
class PortImpl;
-class Task;
+
+struct SingleTask;
+struct SeqTask;
+struct ParTask;
+
+using Task = boost::variant<SingleTask, SeqTask, ParTask>;
/** Graph execution context.
*
@@ -115,7 +122,7 @@ public:
}
/** Claim a parallel task, and signal others that work is available. */
- void claim_task(Task* task);
+ void claim_task(ParTask* task);
/** Steal a task from some other context if possible. */
Task* steal_task() const;
@@ -126,7 +133,7 @@ public:
void join();
inline Engine& engine() const { return _engine; }
- inline Task* task() const { return _task; }
+ inline ParTask* task() const { return _task; }
inline unsigned id() const { return _id; }
inline FrameTime start() const { return _start; }
inline FrameTime time() const { return _start + _offset; }
@@ -143,7 +150,7 @@ protected:
Engine& _engine; ///< Engine we're running in
Raul::RingBuffer* _event_sink; ///< Port updates from process context
- Task* _task; ///< Currently executing task
+ ParTask* _task; ///< Currently executing task
std::thread* _thread; ///< Thread (NULL for main run context)
unsigned _id; ///< Context ID