eeschema: Use recursive mutex for SCH_PIN
We need to be able to lock individual actions while keeping the code modular. The recursive mutex keeps this thread-local. Fixes https://gitlab.com/kicad/code/kicad/issues/5186
This commit is contained in:
parent
b8b3d5c16d
commit
275e810573
|
@ -100,7 +100,7 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||||
|
|
||||||
void SCH_PIN::ClearDefaultNetName( const SCH_SHEET_PATH* aPath )
|
void SCH_PIN::ClearDefaultNetName( const SCH_SHEET_PATH* aPath )
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock( m_netmap_mutex );
|
std::lock_guard<std::recursive_mutex> lock( m_netmap_mutex );
|
||||||
|
|
||||||
if( aPath )
|
if( aPath )
|
||||||
m_net_name_map.erase( *aPath );
|
m_net_name_map.erase( *aPath );
|
||||||
|
@ -114,7 +114,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
|
||||||
if( m_libPin->IsPowerConnection() )
|
if( m_libPin->IsPowerConnection() )
|
||||||
return m_libPin->GetName();
|
return m_libPin->GetName();
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock( m_netmap_mutex );
|
std::lock_guard<std::recursive_mutex> lock( m_netmap_mutex );
|
||||||
|
|
||||||
if( m_net_name_map.count( aPath ) > 0 )
|
if( m_net_name_map.count( aPath ) > 0 )
|
||||||
return m_net_name_map.at( aPath );
|
return m_net_name_map.at( aPath );
|
||||||
|
|
|
@ -40,7 +40,7 @@ class SCH_PIN : public SCH_ITEM
|
||||||
bool m_isDangling;
|
bool m_isDangling;
|
||||||
|
|
||||||
/// The name that this pin connection will drive onto a net
|
/// The name that this pin connection will drive onto a net
|
||||||
std::mutex m_netmap_mutex;
|
std::recursive_mutex m_netmap_mutex;
|
||||||
std::map<const SCH_SHEET_PATH, wxString> m_net_name_map;
|
std::map<const SCH_SHEET_PATH, wxString> m_net_name_map;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue