Lock safety.

We're going to grab the lock every time through anyway,
might as well have it for the reads as well as the
writes.

(cherry picked from commit 95ab9f0b50)
This commit is contained in:
Jeff Young
2025-07-08 08:44:21 +01:00
parent d4a30f8b16
commit 33f004c5a6
+2 -1
View File
@@ -631,8 +631,9 @@ const std::vector<BOARD_CONNECTED_ITEM*>& TRACKS_CLEANER::getConnectedItems( PCB
PCB_ZONE_T };
const std::shared_ptr<CONNECTIVITY_DATA>& connectivity = m_brd->GetConnectivity();
std::lock_guard lock( m_mutex );
if( std::lock_guard lock( m_mutex ); !m_connectedItemsCache.contains( aTrack ) )
if( !m_connectedItemsCache.contains( aTrack ) )
m_connectedItemsCache[aTrack] = connectivity->GetConnectedItems( aTrack, connectedTypes );
return m_connectedItemsCache.at( aTrack );