diff options
Diffstat (limited to 'src/server/RunContext.cpp')
-rw-r--r-- | src/server/RunContext.cpp | 54 |
1 files changed, 21 insertions, 33 deletions
diff --git a/src/server/RunContext.cpp b/src/server/RunContext.cpp index a61e4afb..29985ccf 100644 --- a/src/server/RunContext.cpp +++ b/src/server/RunContext.cpp @@ -22,32 +22,30 @@ #include "PortImpl.hpp" #include "Task.hpp" -#include "ingen/Atom.hpp" -#include "ingen/Forge.hpp" -#include "ingen/Log.hpp" -#include "ingen/URI.hpp" -#include "ingen/URIMap.hpp" -#include "ingen/URIs.hpp" -#include "ingen/World.hpp" -#include "lv2/urid/urid.h" -#include "raul/RingBuffer.hpp" +#include <ingen/Atom.hpp> +#include <ingen/Forge.hpp> +#include <ingen/Log.hpp> +#include <ingen/URI.hpp> +#include <ingen/URIMap.hpp> +#include <ingen/URIs.hpp> +#include <ingen/World.hpp> +#include <lv2/urid/urid.h> +#include <raul/RingBuffer.hpp> #include <cerrno> #include <cstring> #include <pthread.h> #include <sched.h> -namespace ingen { -namespace server { +namespace ingen::server { -struct Notification -{ - explicit inline Notification(PortImpl* p = nullptr, - FrameTime f = 0, - LV2_URID k = 0, - uint32_t s = 0, - LV2_URID t = 0) - : port(p), time(f), key(k), size(s), type(t) +struct Notification { + explicit Notification(PortImpl* p = nullptr, + FrameTime f = 0, + LV2_URID k = 0, + uint32_t s = 0, + LV2_URID t = 0) + : port(p), time(f), key(k), size(s), type(t) {} PortImpl* port; @@ -63,22 +61,13 @@ RunContext::RunContext(Engine& engine, bool threaded) : _engine(engine) , _event_sink(event_sink) - , _task(nullptr) , _thread(threaded ? new std::thread(&RunContext::run, this) : nullptr) , _id(id) - , _start(0) - , _end(0) - , _offset(0) - , _nframes(0) - , _rate(0) - , _realtime(true) {} RunContext::RunContext(const RunContext& copy) : _engine(copy._engine) , _event_sink(copy._event_sink) - , _task(nullptr) - , _thread(nullptr) , _id(copy._id) , _start(copy._start) , _end(copy._end) @@ -171,9 +160,9 @@ void RunContext::set_priority(int priority) { if (_thread) { - pthread_t pthread = _thread->native_handle(); - const int policy = (priority > 0) ? SCHED_FIFO : SCHED_OTHER; - sched_param sp{}; + const pthread_t pthread = _thread->native_handle(); + const int policy = (priority > 0) ? SCHED_FIFO : SCHED_OTHER; + sched_param sp{}; sp.sched_priority = (priority > 0) ? priority : 0; if (pthread_setschedparam(pthread, policy, &sp)) { _engine.log().error( @@ -204,5 +193,4 @@ RunContext::run() } } -} // namespace server -} // namespace ingen +} // namespace ingen::server |