summaryrefslogtreecommitdiffstats
path: root/src/server/RunContext.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-11-12 19:57:56 +0100
committerDavid Robillard <d@drobilla.net>2017-11-12 19:58:13 +0100
commitf8cd75372d9c45a0a8616d89a18a5b9906ac9d54 (patch)
treeeb9b06bc00c2d3b36f1f56cbd6fad7cd33df6ae0 /src/server/RunContext.hpp
parenta66df006ccd3426148491f0a4c21c9facb8104ea (diff)
downloadingen-f8cd75372d9c45a0a8616d89a18a5b9906ac9d54.tar.gz
ingen-f8cd75372d9c45a0a8616d89a18a5b9906ac9d54.tar.bz2
ingen-f8cd75372d9c45a0a8616d89a18a5b9906ac9d54.zip
WIP: Clean up task implementationtasks
Diffstat (limited to 'src/server/RunContext.hpp')
-rw-r--r--src/server/RunContext.hpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/server/RunContext.hpp b/src/server/RunContext.hpp
index 87fb0fed..939371e7 100644
--- a/src/server/RunContext.hpp
+++ b/src/server/RunContext.hpp
@@ -23,11 +23,13 @@
#include "ingen/World.hpp"
#include "raul/RingBuffer.hpp"
+#include "Runner.hpp"
#include "types.hpp"
namespace Ingen {
namespace Server {
+class BlockImpl;
class Engine;
class PortImpl;
class Task;
@@ -44,9 +46,11 @@ class Task;
*
* \ingroup engine
*/
-class RunContext
+class RunContext : public Runner
{
public:
+ using BlockTask = Task;
+
/** Create a new run context.
*
* @param engine The engine this context is running within.
@@ -115,10 +119,13 @@ public:
}
/** Claim a parallel task, and signal others that work is available. */
- void claim_task(Task* task);
+ void claim_task(BlockTask* task) override;
/** Steal a task from some other context if possible. */
- Task* steal_task() const;
+ BlockTask* steal_task() const override;
+
+ /** Run `unit`. */
+ void run_unit(BlockImpl* unit) override;
void set_priority(int priority);
void set_rate(SampleCount rate) { _rate = rate; }
@@ -126,7 +133,7 @@ public:
void join();
inline Engine& engine() const { return _engine; }
- inline Task* task() const { return _task; }
+ inline BlockTask* 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
+ BlockTask* _task; ///< Currently executing task
std::thread* _thread; ///< Thread (NULL for main run context)
unsigned _id; ///< Context ID