summaryrefslogtreecommitdiffstats
path: root/src/engine/ThreadManager.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-29 01:43:54 +0000
committerDavid Robillard <d@drobilla.net>2010-01-29 01:43:54 +0000
commitd5a514148bec58cd7e97d032259362b2e19c0e95 (patch)
tree64ea4dd182a8918b47a6d5f391e2cd097aebb526 /src/engine/ThreadManager.hpp
parent36039b294ee823ceb2c239129defc5eafa110247 (diff)
downloadingen-d5a514148bec58cd7e97d032259362b2e19c0e95.tar.gz
ingen-d5a514148bec58cd7e97d032259362b2e19c0e95.tar.bz2
ingen-d5a514148bec58cd7e97d032259362b2e19c0e95.zip
Magic MIDI binding via special ingen_control port.
Always set lv2:minimum and lv2:maximum properties for control ports so they show up in properties dialog (and can be used for MIDI binding). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2391 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/ThreadManager.hpp')
-rw-r--r--src/engine/ThreadManager.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/ThreadManager.hpp b/src/engine/ThreadManager.hpp
index 6821949c..26368deb 100644
--- a/src/engine/ThreadManager.hpp
+++ b/src/engine/ThreadManager.hpp
@@ -18,6 +18,7 @@
#ifndef THREADMANAGER_H
#define THREADMANAGER_H
+#include <cassert>
#include "raul/Thread.hpp"
namespace Ingen {
@@ -36,6 +37,19 @@ public:
inline static ThreadID current_thread_id() {
return (ThreadID)Raul::Thread::get().context();
}
+
+ inline static void assert_thread(ThreadID id) {
+ assert(single_threaded || current_thread_id() == id);
+ }
+
+ inline static void assert_not_thread(ThreadID id) {
+ assert(single_threaded || current_thread_id() != id);
+ }
+
+ /** Set to true during initialisation so ensure_thread doesn't fail.
+ * Defined in Engine.cpp
+ */
+ static bool single_threaded;
};