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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user