Image Gradient: Switch to shared_mutex (#6558)

* Improve lock contention by switching to a shared_lock.
ImageGradient is accessed via a many-reader-one-writer pattern, so a shared_lock causes less contention in the common "read" case.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Remove chatty profile marker.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2021-12-23 14:16:22 -06:00
committed by GitHub
parent f1a1cb3ec0
commit 3e9b76cdee
3 changed files with 8 additions and 10 deletions
@@ -88,8 +88,6 @@ namespace GradientSignal
inline float GradientSampler::GetValue(const GradientSampleParams& sampleParams) const
{
AZ_PROFILE_FUNCTION(Entity);
if (m_opacity <= 0.0f || !m_gradientId.IsValid())
{
return 0.0f;