fix deadlock in DRC "Checking keeopouts & disallow constraints"

This commit is contained in:
Armin Schoisswohl 2024-03-06 11:06:50 +01:00 committed by Jeff Young
parent 4590455ab2
commit 991ff71f33
2 changed files with 4 additions and 3 deletions

View File

@ -648,7 +648,6 @@ static void intersectsAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
if( !aArea->GetBoundingBox().Intersects( itemBBox ) )
return false;
std::unique_lock<std::mutex> cacheLock( board->m_CachesMutex );
LSET testLayers;
PTR_PTR_LAYER_CACHE_KEY key;
@ -661,6 +660,7 @@ static void intersectsAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
{
if( ( item->GetFlags() & ROUTER_TRANSIENT ) == 0 )
{
std::unique_lock<std::mutex> cacheLock( board->m_CachesMutex );
key = { aArea, item, layer };
auto i = board->m_IntersectsAreaCache.find( key );
@ -672,7 +672,10 @@ static void intersectsAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
bool collides = collidesWithArea( item, context, aArea );
if( ( item->GetFlags() & ROUTER_TRANSIENT ) == 0 )
{
std::unique_lock<std::mutex> cacheLock( board->m_CachesMutex );
board->m_IntersectsAreaCache[ key ] = collides;
}
if( collides )
return true;

View File

@ -368,9 +368,7 @@ void ZONE::CacheBoundingBox()
auto cacheIter = cache.find( this );
if( cacheIter == cache.end() )
{
cache[ this ] = m_Poly->BBox();
}
}