mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
locking
This commit is contained in:
parent
9937b6a3ef
commit
9a2aa9a337
2 changed files with 13 additions and 5 deletions
|
@ -24,16 +24,24 @@ AssignmentAction::~AssignmentAction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignmentAction::removeFromSimulation(EntitySimulation* simulation) const {
|
void AssignmentAction::removeFromSimulation(EntitySimulation* simulation) const {
|
||||||
simulation->removeAction(_id);
|
withReadLock([&]{
|
||||||
simulation->applyActionChanges();
|
simulation->removeAction(_id);
|
||||||
|
simulation->applyActionChanges();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AssignmentAction::serialize() const {
|
QByteArray AssignmentAction::serialize() const {
|
||||||
return _data;
|
QByteArray result;
|
||||||
|
withReadLock([&]{
|
||||||
|
result = _data;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignmentAction::deserialize(QByteArray serializedArguments) {
|
void AssignmentAction::deserialize(QByteArray serializedArguments) {
|
||||||
_data = serializedArguments;
|
withWriteLock([&]{
|
||||||
|
_data = serializedArguments;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AssignmentAction::updateArguments(QVariantMap arguments) {
|
bool AssignmentAction::updateArguments(QVariantMap arguments) {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "EntityActionInterface.h"
|
#include "EntityActionInterface.h"
|
||||||
|
|
||||||
|
|
||||||
class AssignmentAction : public EntityActionInterface {
|
class AssignmentAction : public EntityActionInterface, public ReadWriteLockable {
|
||||||
public:
|
public:
|
||||||
AssignmentAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
AssignmentAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
||||||
virtual ~AssignmentAction();
|
virtual ~AssignmentAction();
|
||||||
|
|
Loading…
Reference in a new issue