mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 05:52:31 +02:00
avoid unneeded read-lock if action-data was dirty
This commit is contained in:
parent
d504f449e4
commit
08a0bf33a4
1 changed files with 5 additions and 4 deletions
|
@ -1795,12 +1795,13 @@ const QByteArray EntityItem::getActionData() const {
|
||||||
EntityItem* unconstThis = const_cast<EntityItem*>(this);
|
EntityItem* unconstThis = const_cast<EntityItem*>(this);
|
||||||
unconstThis->withWriteLock([&] {
|
unconstThis->withWriteLock([&] {
|
||||||
getActionDataInternal();
|
getActionDataInternal();
|
||||||
|
result = _allActionsDataCache;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
withReadLock([&] {
|
||||||
|
result = _allActionsDataCache;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
withReadLock([&] {
|
|
||||||
result = _allActionsDataCache;
|
|
||||||
});
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue