summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-14 05:45:15 +0000
committerDavid Robillard <d@drobilla.net>2012-05-14 05:45:15 +0000
commiteee943caa90c2c18777865ed835aa2ca9f92f947 (patch)
tree2d993bd7d18b0305852d34d34d513d08d29666dd /src
parentbf7116520bc723980edb1120eaa66455a4c66ca5 (diff)
downloadingen-eee943caa90c2c18777865ed835aa2ca9f92f947.tar.gz
ingen-eee943caa90c2c18777865ed835aa2ca9f92f947.tar.bz2
ingen-eee943caa90c2c18777865ed835aa2ca9f92f947.zip
Clean up Thread interface.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4411 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/gui/ThreadedLoader.cpp5
-rw-r--r--src/server/JackDriver.cpp3
-rw-r--r--src/server/PreProcessor.cpp2
-rw-r--r--src/server/ProcessSlave.hpp15
-rw-r--r--src/server/ingen_lv2.cpp4
-rw-r--r--src/socket/SocketListener.cpp5
-rw-r--r--src/socket/SocketReader.cpp4
7 files changed, 15 insertions, 23 deletions
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp
index 81bec1eb..1867b8d5 100644
--- a/src/gui/ThreadedLoader.cpp
+++ b/src/gui/ThreadedLoader.cpp
@@ -30,11 +30,10 @@ namespace Ingen {
namespace GUI {
ThreadedLoader::ThreadedLoader(App& app, SharedPtr<Interface> engine)
- : _app(app)
+ : Raul::Slave("Loader")
+ , _app(app)
, _engine(engine)
{
- set_name("Loader");
-
if (parser())
start();
else
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 0c810f73..30673316 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -427,8 +427,7 @@ JackDriver::_process_cb(jack_nframes_t nframes)
void
JackDriver::_thread_init_cb()
{
- Raul::Thread* thread = &Raul::Thread::get();
- thread->set_name("Jack");
+ Raul::Thread* thread = &Raul::Thread::get("Jack");
ThreadManager::set_flag(THREAD_PROCESS);
ThreadManager::set_flag(THREAD_IS_REAL_TIME);
_jack_threads.push_back(SharedPtr<Raul::Thread>(thread));
diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp
index 9fba676c..013a43dd 100644
--- a/src/server/PreProcessor.cpp
+++ b/src/server/PreProcessor.cpp
@@ -26,8 +26,8 @@ namespace Ingen {
namespace Server {
PreProcessor::PreProcessor()
+ : Raul::Slave("PreProcessor")
{
- set_name("PreProcessor");
start();
}
diff --git a/src/server/ProcessSlave.hpp b/src/server/ProcessSlave.hpp
index 0e866f71..f3b514ca 100644
--- a/src/server/ProcessSlave.hpp
+++ b/src/server/ProcessSlave.hpp
@@ -17,8 +17,6 @@
#ifndef INGEN_ENGINE_PROCESSSLAVE_HPP
#define INGEN_ENGINE_PROCESSSLAVE_HPP
-#include <sstream>
-
#include "raul/Array.hpp"
#include "raul/AtomicInt.hpp"
#include "raul/Slave.hpp"
@@ -37,22 +35,19 @@ class CompiledPatch;
class ProcessSlave : protected Raul::Slave {
public:
ProcessSlave(Engine& engine, bool realtime)
- : _engine(engine)
+ : Raul::Slave((Raul::fmt("Process Slave %1%") % _next_id).str())
+ , _engine(engine)
, _context(NULL)
, _id(_next_id++)
, _index(0)
, _state(STATE_FINISHED)
, _compiled_patch(NULL)
{
- std::stringstream ss;
- ss << "Process Slave ";
- ss << _id;
- set_name(ss.str());
-
start();
- if (realtime)
- set_scheduling(SCHED_FIFO, 40);
+ if (realtime) {
+ set_scheduling(true, 40);
+ }
}
~ProcessSlave() {
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index f394e566..2cc12846 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -364,7 +364,8 @@ class MainThread : public Raul::Thread
public:
explicit MainThread(SharedPtr<Engine> engine,
LV2Driver* driver)
- : _engine(engine)
+ : Raul::Thread("Main")
+ , _engine(engine)
, _driver(driver)
{}
@@ -499,7 +500,6 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
engine->set_driver(SharedPtr<Ingen::Server::Driver>(driver));
plugin->main = new MainThread(engine, driver);
- plugin->main->set_name("Main");
SharedPtr<Interface> client(&driver->writer(), NullDeleter<Interface>);
interface->set_respondee(client);
diff --git a/src/socket/SocketListener.cpp b/src/socket/SocketListener.cpp
index cbd29d7e..a2dcaba0 100644
--- a/src/socket/SocketListener.cpp
+++ b/src/socket/SocketListener.cpp
@@ -38,12 +38,11 @@ namespace Ingen {
namespace Socket {
SocketListener::SocketListener(Ingen::Shared::World& world)
- : _world(world)
+ : Raul::Thread("SocketListener")
+ , _world(world)
, _unix_sock(Socket::UNIX)
, _net_sock(Socket::TCP)
{
- set_name("SocketListener");
-
// Create UNIX socket
_unix_path = world.conf().option("socket").get_string();
const std::string unix_uri = "unix://" + _unix_path;
diff --git a/src/socket/SocketReader.cpp b/src/socket/SocketReader.cpp
index 80a9bd22..1a3e5475 100644
--- a/src/socket/SocketReader.cpp
+++ b/src/socket/SocketReader.cpp
@@ -34,13 +34,13 @@ namespace Socket {
SocketReader::SocketReader(Ingen::Shared::World& world,
Interface& iface,
SharedPtr<Socket> sock)
- : _world(world)
+ : Raul::Thread("SocketReader")
+ , _world(world)
, _iface(iface)
, _inserter(NULL)
, _msg_node(NULL)
, _socket(sock)
{
- set_name("SocketReader");
start();
}