Browse Source

Fixed spurious TSAN failure when running out of space in the profiler

Jorrit Rouwe 8 months ago
parent
commit
ae863ad639
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Jolt/Core/Profiler.inl

+ 2 - 1
Jolt/Core/Profiler.inl

@@ -23,6 +23,7 @@ ProfileThread::~ProfileThread()
 // ProfileMeasurement
 //////////////////////////////////////////////////////////////////////////////////////////
 
+JPH_TSAN_NO_SANITIZE // TSAN reports a race on sOutOfSamplesReported, however the worst case is that we report the out of samples message multiple times
 ProfileMeasurement::ProfileMeasurement(const char *inName, uint32 inColor)
 {
 	ProfileThread *current_thread = ProfileThread::sGetInstance();
@@ -48,8 +49,8 @@ ProfileMeasurement::ProfileMeasurement(const char *inName, uint32 inColor)
 		// Out of samples
 		if (!sOutOfSamplesReported)
 		{
-			Trace("ProfileMeasurement: Too many samples, some data will be lost!");
 			sOutOfSamplesReported = true;
+			Trace("ProfileMeasurement: Too many samples, some data will be lost!");
 		}
 		mSample = nullptr;
 	}