Browse Source

Thread safety for pad effective shape building.

6.0.7
Jeff Young 5 years ago
parent
commit
3e2aa8df3a
  1. 7
      pcbnew/pad.cpp
  2. 1
      pcbnew/pad.h

7
pcbnew/pad.cpp

@ -299,6 +299,13 @@ int PAD::GetBoundingRadius() const
void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
{
std::lock_guard<std::mutex> RAII_lock( m_shapesBuildingLock );
// If we had to wait for the lock then we were probably waiting for someone else to
// finish rebuilding the shapes. So check to see if they're clean now.
if( !m_shapesDirty )
return;
BOARD* board = GetBoard();
int maxError = board ? board->GetDesignSettings().m_MaxError : ARC_HIGH_DEF;

1
pcbnew/pad.h

@ -655,6 +655,7 @@ private:
// Must be set to true to force rebuild shapes to draw (after geometry change for instance)
mutable bool m_shapesDirty;
mutable std::mutex m_shapesBuildingLock;
mutable int m_effectiveBoundingRadius;
mutable EDA_RECT m_effectiveBoundingBox;
mutable std::shared_ptr<SHAPE_COMPOUND> m_effectiveShape;

Loading…
Cancel
Save