summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/Engine.cpp4
-rw-r--r--src/server/PreProcessor.cpp2
-rw-r--r--src/server/ThreadManager.hpp6
-rw-r--r--src/server/events/Mark.hpp2
-rw-r--r--src/server/util.hpp8
5 files changed, 16 insertions, 6 deletions
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index a8c51f20..0b468ce1 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -62,8 +62,8 @@ using namespace std;
namespace Ingen {
namespace Server {
-thread_local unsigned ThreadManager::flags(0);
-bool ThreadManager::single_threaded(true);
+INGEN_THREAD_LOCAL unsigned ThreadManager::flags(0);
+bool ThreadManager::single_threaded(true);
Engine::Engine(Ingen::World* world)
: _world(world)
diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp
index e6f3dad7..9933bde2 100644
--- a/src/server/PreProcessor.cpp
+++ b/src/server/PreProcessor.cpp
@@ -91,7 +91,7 @@ PreProcessor::process(RunContext& context, PostProcessor& dest, size_t limit)
Event* ev = head;
Event* last = ev;
while (ev && ev->is_prepared()) {
- switch (_block_state) {
+ switch (_block_state.load()) {
case BlockState::UNBLOCKED:
break;
case BlockState::PRE_BLOCKED:
diff --git a/src/server/ThreadManager.hpp b/src/server/ThreadManager.hpp
index bec7d614..3bcedf30 100644
--- a/src/server/ThreadManager.hpp
+++ b/src/server/ThreadManager.hpp
@@ -21,6 +21,8 @@
#include "ingen/ingen.h"
+#include "util.hpp"
+
namespace Ingen {
namespace Server {
@@ -56,8 +58,8 @@ public:
/** Set to true during initialisation so ensure_thread doesn't fail.
* Defined in Engine.cpp
*/
- static bool single_threaded;
- static thread_local unsigned flags;
+ static bool single_threaded;
+ static INGEN_THREAD_LOCAL unsigned flags;
};
} // namespace Server
diff --git a/src/server/events/Mark.hpp b/src/server/events/Mark.hpp
index f2c02b93..68ba5149 100644
--- a/src/server/events/Mark.hpp
+++ b/src/server/events/Mark.hpp
@@ -50,7 +50,7 @@ public:
void execute(RunContext& context);
void post_process();
- Execution get_execution() const override;
+ Execution get_execution() const;
private:
typedef std::map<GraphImpl*, CompiledGraph*> CompiledGraphs;
diff --git a/src/server/util.hpp b/src/server/util.hpp
index d6377a9e..7d30cc8f 100644
--- a/src/server/util.hpp
+++ b/src/server/util.hpp
@@ -35,6 +35,14 @@
# define REALTIME
#endif
+#if defined(INGEN_HAVE_THREAD_LOCAL)
+# define INGEN_THREAD_LOCAL thread_local
+#elif defined(INGEN_HAVE_THREAD_BUILTIN)
+# define INGEN_THREAD_LOCAL __thread
+#else
+# define INGEN_THREAD_LOCAL
+#endif
+
namespace Ingen {
namespace Server {