Fix ConcurrentSystemLocker to have exclusive lock as an option

This commit is contained in:
Wojtek Figat
2025-06-29 19:16:41 +02:00
parent 43d11264f8
commit 78d519cb9a
4 changed files with 14 additions and 12 deletions

View File

@@ -127,7 +127,7 @@ void SceneRendering::CollectPostFxVolumes(RenderContext& renderContext)
void SceneRendering::Clear()
{
ConcurrentSystemLocker::WriteScope lock(Locker);
ConcurrentSystemLocker::WriteScope lock(Locker, true);
for (auto* listener : _listeners)
{
listener->OnSceneRenderingClear(this);
@@ -149,7 +149,7 @@ void SceneRendering::AddActor(Actor* a, int32& key)
return;
PROFILE_MEM(Graphics);
const int32 category = a->_drawCategory;
ConcurrentSystemLocker::WriteScope lock(Locker);
ConcurrentSystemLocker::WriteScope lock(Locker, true);
auto& list = Actors[category];
if (FreeActors[category].HasItems())
{
@@ -193,7 +193,7 @@ void SceneRendering::UpdateActor(Actor* a, int32& key, ISceneRenderingListener::
void SceneRendering::RemoveActor(Actor* a, int32& key)
{
const int32 category = a->_drawCategory;
ConcurrentSystemLocker::WriteScope lock(Locker);
ConcurrentSystemLocker::WriteScope lock(Locker, true);
auto& list = Actors[category];
if (list.Count() > key) // Ignore invalid key softly (eg. list after batch clear during scene unload)
{