IncrementTimeStamp() lock safety.

Increment is only called once per op, so it's not
overly performance critical.  Better to have the
lock when reading the cache values.

(cherry picked from commit a7a83efc466fa0872e28bf6df13a5b7c73a42f8b)
This commit is contained in:
Jeff Young 2025-06-08 11:34:44 +01:00
parent e12748e669
commit b21ba7c2aa

View File

@ -258,6 +258,8 @@ void BOARD::ClearProject()
void BOARD::IncrementTimeStamp()
{
std::unique_lock<std::shared_mutex> writeLock( m_CachesMutex );
m_timeStamp++;
if( !m_IntersectsAreaCache.empty()
@ -271,8 +273,6 @@ void BOARD::IncrementTimeStamp()
|| m_maxClearanceValue.has_value()
|| !m_itemByIdCache.empty() )
{
std::unique_lock<std::shared_mutex> writeLock( m_CachesMutex );
m_IntersectsAreaCache.clear();
m_EnclosedByAreaCache.clear();
m_IntersectsCourtyardCache.clear();