summaryrefslogtreecommitdiffstats
path: root/src/server/ingen_lv2.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-05-23 03:20:40 +0000
committerDavid Robillard <d@drobilla.net>2015-05-23 03:20:40 +0000
commitdc5c579778d8b7b6f113c48d202f89c172abd591 (patch)
tree7a3a24f7acfab09c652ca466a46099766c8a02d3 /src/server/ingen_lv2.cpp
parent63d4ffa098e016a9680b4b1b1f209ab3bb3dbd8c (diff)
downloadingen-dc5c579778d8b7b6f113c48d202f89c172abd591.tar.gz
ingen-dc5c579778d8b7b6f113c48d202f89c172abd591.tar.bz2
ingen-dc5c579778d8b7b6f113c48d202f89c172abd591.zip
Prevent concurrent Sord access.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5683 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/ingen_lv2.cpp')
-rw-r--r--src/server/ingen_lv2.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index 2259b758..8265cce8 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -583,6 +583,8 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
engine->process_events();
engine->post_processor()->process();
+ std::lock_guard<std::mutex> lock(plugin->world->rdf_mutex());
+
plugin->world->parser()->parse_file(plugin->world,
plugin->world->interface().get(),
graph->filename);
@@ -707,9 +709,14 @@ ingen_save(LV2_Handle instance,
char* state_path = map_path->abstract_path(map_path->handle, real_path);
Ingen::Store::iterator root = plugin->world->store()->find(Raul::Path("/"));
- plugin->world->serialiser()->start_to_file(root->second->path(), real_path);
- plugin->world->serialiser()->serialise(root->second);
- plugin->world->serialiser()->finish();
+
+ {
+ std::lock_guard<std::mutex> lock(plugin->world->rdf_mutex());
+
+ plugin->world->serialiser()->start_to_file(root->second->path(), real_path);
+ plugin->world->serialiser()->serialise(root->second);
+ plugin->world->serialiser()->finish();
+ }
store(handle,
ingen_file,
@@ -772,6 +779,7 @@ ingen_restore(LV2_Handle instance,
}
// Load new graph
+ std::lock_guard<std::mutex> lock(plugin->world->rdf_mutex());
plugin->world->parser()->parse_file(
plugin->world, plugin->world->interface().get(), real_path);