mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
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:
parent
e12748e669
commit
b21ba7c2aa
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user