diff --git a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp index 3ed4b4612c5dd3f6e0afbd71630dba7a4753f460..e007e8f5e3ad47c57f9bb71c75e517d57af1addf 100644 --- a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp +++ b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp @@ -122,7 +122,7 @@ namespace armarx using namespace armarx::RemoteGui::Client; { - std::scoped_lock lock(workingMemoryMutex); + // Core segments are locked by MemoryRemoteGui. tab.memoryGroup = armem::server::MemoryRemoteGui().makeGroupBox(workingMemory); } diff --git a/source/RobotAPI/libraries/armem/server/MemoryRemoteGui.cpp b/source/RobotAPI/libraries/armem/server/MemoryRemoteGui.cpp index 9ab34efd946541a37ae825d6338a355aec0dd722..9347cb7e9234723d33407693cb68ec1f5ea8448d 100644 --- a/source/RobotAPI/libraries/armem/server/MemoryRemoteGui.cpp +++ b/source/RobotAPI/libraries/armem/server/MemoryRemoteGui.cpp @@ -31,9 +31,10 @@ namespace armarx::armem::server } - MemoryRemoteGui::GroupBox MemoryRemoteGui::makeGroupBox(const wm::CoreSegment& coreSegment) const { + std::scoped_lock lock(coreSegment.mutex()); + GroupBox group; group.setLabel(makeGroupLabel("Core Segment", coreSegment.name(), coreSegment.providerSegments().size())); @@ -50,7 +51,6 @@ namespace armarx::armem::server } - MemoryRemoteGui::GroupBox MemoryRemoteGui::makeGroupBox(const wm::ProviderSegment& providerSegment) const { GroupBox group; @@ -69,7 +69,6 @@ namespace armarx::armem::server } - MemoryRemoteGui::GroupBox MemoryRemoteGui::makeGroupBox(const wm::Entity& entity) const { GroupBox group; @@ -109,7 +108,6 @@ namespace armarx::armem::server } - MemoryRemoteGui::GroupBox MemoryRemoteGui::makeGroupBox(const wm::EntitySnapshot& snapshot) const { GroupBox group; @@ -129,6 +127,7 @@ namespace armarx::armem::server return group; } + MemoryRemoteGui::GroupBox MemoryRemoteGui::makeGroupBox(const wm::EntityInstance& instance) const { GroupBox group; @@ -153,7 +152,6 @@ namespace armarx::armem::server } - std::string MemoryRemoteGui::makeGroupLabel( const std::string& term, const std::string& name, size_t size, const std::string& namePrefix, const std::string& nameSuffix) const