change m_CachesMutex to shared_mutex and do shared locking for read access in zone BBox calculations
This commit is contained in:
committed by
Jeff Young
parent
991ff71f33
commit
bb9448edcb
@@ -57,12 +57,12 @@ public:
|
||||
// in the ENUM_MAP: one for the canonical layer name and one for the user layer name.
|
||||
// We need to check against both.
|
||||
|
||||
wxPGChoices& layerMap = ENUM_MAP<PCB_LAYER_ID>::Instance().Choices();
|
||||
const wxString& layerName = b->AsString();
|
||||
BOARD* board = static_cast<PCBEXPR_CONTEXT*>( aCtx )->GetBoard();
|
||||
std::unique_lock<std::mutex> cacheLock( board->m_CachesMutex );
|
||||
auto i = board->m_LayerExpressionCache.find( layerName );
|
||||
LSET mask;
|
||||
wxPGChoices& layerMap = ENUM_MAP<PCB_LAYER_ID>::Instance().Choices();
|
||||
const wxString& layerName = b->AsString();
|
||||
BOARD* board = static_cast<PCBEXPR_CONTEXT*>( aCtx )->GetBoard();
|
||||
std::unique_lock<std::shared_mutex> cacheLock( board->m_CachesMutex );
|
||||
auto i = board->m_LayerExpressionCache.find( layerName );
|
||||
LSET mask;
|
||||
|
||||
if( i == board->m_LayerExpressionCache.end() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user