Skip to content
Snippets Groups Projects
Commit 122302a6 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add mutex to wm::CoreSegment

parent af0341c3
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,14 @@
namespace armarx::armem::wm
{
CoreSegment::CoreSegment(const CoreSegment& other) :
CoreSegment::Base(other),
_mutex()
{
// Do not copy _mutex.
}
Commit CoreSegment::toCommit() const
{
Commit c;
......@@ -18,6 +26,7 @@ namespace armarx::armem::wm
return c;
}
void CoreSegment::_copySelfWithoutData(CoreSegment& other) const
{
other.id() = _id;
......@@ -27,4 +36,11 @@ namespace armarx::armem::wm
other.addProviderSegment(s.copyWithoutData());
}
}
std::mutex& CoreSegment::mutex() const
{
return _mutex;
}
}
#pragma once
#include <mutex>
#include "../base/CoreSegmentBase.h"
#include "ProviderSegment.h"
......@@ -22,7 +24,7 @@ namespace armarx::armem::wm
using Base::CoreSegmentBase;
CoreSegment(const CoreSegment& other) = default;
CoreSegment(const CoreSegment& other);
CoreSegment(CoreSegment&& other) = default;
CoreSegment& operator=(const CoreSegment& other) = default;
CoreSegment& operator=(CoreSegment&& other) = default;
......@@ -33,10 +35,15 @@ namespace armarx::armem::wm
*/
Commit toCommit() const;
std::mutex& mutex() const;
protected:
virtual void _copySelfWithoutData(CoreSegment& other) const override;
mutable std::mutex _mutex;
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment