From c7c64abd524911ee8bf3e2be9d8aec38b1b4d18a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Oct 2016 21:47:07 -0400 Subject: Fix potential store deadlock --- src/server/events/Connect.cpp | 2 +- src/server/events/Copy.cpp | 2 +- src/server/events/Delete.cpp | 2 +- src/server/events/Delta.cpp | 2 +- src/server/events/Delta.hpp | 2 +- src/server/events/Disconnect.cpp | 2 +- src/server/events/DisconnectAll.cpp | 2 +- src/server/events/Get.cpp | 2 +- src/server/events/Move.cpp | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index 35084ea6..34dc569e 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -52,7 +52,7 @@ Connect::Connect(Engine& engine, bool Connect::pre_process(PreProcessContext& ctx) { - std::lock_guard lock(_engine.store()->mutex()); + std::lock_guard lock(_engine.store()->mutex()); Node* tail = _engine.store()->get(_tail_path); if (!tail) { diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp index 30ffb43d..4356e312 100644 --- a/src/server/events/Copy.cpp +++ b/src/server/events/Copy.cpp @@ -51,7 +51,7 @@ Copy::Copy(Engine& engine, bool Copy::pre_process(PreProcessContext& ctx) { - std::lock_guard lock(_engine.store()->mutex()); + std::lock_guard lock(_engine.store()->mutex()); if (Node::uri_is_path(_old_uri)) { // Old URI is a path within the engine diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index bab2594a..d04f176c 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -86,7 +86,7 @@ Delete::pre_process(PreProcessContext& ctx) } // Take a writer lock while we modify the store - std::lock_guard lock(_engine.store()->mutex()); + std::lock_guard lock(_engine.store()->mutex()); _engine.store()->remove(iter, _removed_objects); diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index ad4f78a1..66897c66 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -175,7 +175,7 @@ Delta::pre_process(PreProcessContext& ctx) } // Take a writer lock while we modify the store - std::unique_lock lock(_engine.store()->mutex()); + std::unique_lock lock(_engine.store()->mutex()); _object = is_graph_object ? static_cast(_engine.store()->get(Node::uri_to_path(_subject))) diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index 9e6cbecd..98570210 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -115,7 +115,7 @@ private: boost::optional _preset; - std::unique_lock _poly_lock; ///< Long-term lock for poly changes + std::unique_lock _poly_lock; ///< Long-term lock for poly changes }; } // namespace Events diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index 476a0cee..40b85c22 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -116,7 +116,7 @@ Disconnect::Impl::Impl(Engine& e, bool Disconnect::pre_process(PreProcessContext& ctx) { - std::lock_guard lock(_engine.store()->mutex()); + std::lock_guard lock(_engine.store()->mutex()); if (_tail_path.parent().parent() != _head_path.parent().parent() && _tail_path.parent() != _head_path.parent().parent() diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 2dea6a76..8ce14e74 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -84,7 +84,7 @@ DisconnectAll::~DisconnectAll() bool DisconnectAll::pre_process(PreProcessContext& ctx) { - std::unique_lock lock(_engine.store()->mutex(), std::defer_lock); + std::unique_lock lock(_engine.store()->mutex(), std::defer_lock); if (!_deleting) { lock.lock(); diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp index dfa16ef5..618b8c80 100644 --- a/src/server/events/Get.cpp +++ b/src/server/events/Get.cpp @@ -48,7 +48,7 @@ Get::Get(Engine& engine, bool Get::pre_process(PreProcessContext& ctx) { - std::lock_guard lock(_engine.store()->mutex()); + std::lock_guard lock(_engine.store()->mutex()); if (_uri == "ingen:/plugins") { _plugins = _engine.block_factory()->plugins(); diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp index aee74ab6..1563de13 100644 --- a/src/server/events/Move.cpp +++ b/src/server/events/Move.cpp @@ -48,7 +48,7 @@ Move::~Move() bool Move::pre_process(PreProcessContext& ctx) { - std::lock_guard lock(_engine.store()->mutex()); + std::lock_guard lock(_engine.store()->mutex()); if (!_old_path.parent().is_parent_of(_new_path)) { return Event::pre_process_done(Status::PARENT_DIFFERS, _new_path); -- cgit v1.2.1