From dc5c579778d8b7b6f113c48d202f89c172abd591 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 23 May 2015 03:20:40 +0000 Subject: Prevent concurrent Sord access. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5683 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/JackDriver.cpp | 2 ++ src/server/ingen_lv2.cpp | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/server') diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index ab4054b7..b4e3add3 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -527,6 +527,8 @@ JackDriver::_session_cb(jack_session_event_t* event) SPtr serialiser = _engine.world()->serialiser(); if (serialiser) { + std::lock_guard lock(_engine.world()->rdf_mutex()); + SPtr root(_engine.root_graph(), NullDeleter); serialiser->write_bundle(root, string("file://") + event->session_dir); } 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 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 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 lock(plugin->world->rdf_mutex()); plugin->world->parser()->parse_file( plugin->world, plugin->world->interface().get(), real_path); -- cgit v1.2.1