summaryrefslogtreecommitdiffstats
path: root/src/server/Engine.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Engine.hpp')
-rw-r--r--src/server/Engine.hpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp
index 16699293..2d5e053e 100644
--- a/src/server/Engine.hpp
+++ b/src/server/Engine.hpp
@@ -17,9 +17,10 @@
#ifndef INGEN_ENGINE_ENGINE_HPP
#define INGEN_ENGINE_ENGINE_HPP
-#include <random>
-
#include <boost/utility.hpp>
+#include <condition_variable>
+#include <mutex>
+#include <random>
#include "ingen/EngineBase.hpp"
#include "ingen/Interface.hpp"
@@ -115,7 +116,14 @@ public:
Worker* worker() const { return _worker; }
Worker* sync_worker() const { return _sync_worker; }
- RunContext& run_context() { return _run_context; }
+ RunContext& run_context() { return *_run_contexts[0]; }
+
+ void locate(FrameTime s, SampleCount nframes);
+ void emit_notifications(FrameTime end);
+ bool pending_notifications();
+ bool wait_for_tasks();
+ void signal_tasks();
+ Task* steal_task(unsigned start_thread);
SPtr<Store> store() const;
@@ -144,11 +152,14 @@ private:
Worker* _sync_worker;
SocketListener* _listener;
- RunContext _run_context;
+ std::vector<RunContext*> _run_contexts;
std::mt19937 _rand_engine;
std::uniform_real_distribution<float> _uniform_dist;
+ std::condition_variable _tasks_available;
+ std::mutex _tasks_mutex;
+
bool _quit_flag;
bool _direct_driver;
bool _atomic_bundles;