summaryrefslogtreecommitdiffstats
path: root/src/server/RunContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/RunContext.cpp')
-rw-r--r--src/server/RunContext.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/server/RunContext.cpp b/src/server/RunContext.cpp
index a61e4afb..95d68f57 100644
--- a/src/server/RunContext.cpp
+++ b/src/server/RunContext.cpp
@@ -37,17 +37,15 @@
#include <pthread.h>
#include <sched.h>
-namespace ingen {
-namespace 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)
+namespace ingen::server {
+
+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