kicad/libs/kimath/include/geometry
StefanBruens e07b4ce8e4 Fix triangulationValid check race for zone fill
The m_triangulationValid flag is used in several places without holding
the mutex, thus it should only ever be set when the triangulation is
guaranteed to be valid.

This can either be done by protecting both data and flag by the same
mutex, or updating the flag only after the triangulation has finished.

Also fix the case when the triangulation actually fails, the flag should
not be set in this case.

While at it, simplify the recalculation check. Only if both the
triangulation is valid, and the data hash is unchanged the recalculation
can be skipped - this is typically the case when two threads try to
update the cache concurrently, the second one will block at the mutex,
and will see the valid data after the first thread has finished.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17180
2024-03-14 22:26:23 +00:00
..
chamfer.h ADDED: Move Corner To... and Move Midpoint To... 2023-08-05 16:43:55 +01:00
circle.h Add CIRCLE::Contains( VECTOR2I aP ) and add unit tests 2021-07-03 19:37:50 +00:00
convex_hull.h A bit more angle cleanup. 2022-01-18 09:48:24 +00:00
corner_strategy.h Move CORNER_STRATEGY out of SHAPE_POLY_SET. 2023-10-06 15:42:50 +03:00
direction45.h PNS: Add support for 90-degree corner modes 2021-11-03 02:14:23 +00:00
eda_angle.h EDA_ANGLE: use constexpr for constant angles 2024-01-31 19:17:46 +03:00
ellipse.h Support DXF ellipses and elliptical arcs 2022-12-24 22:46:07 -05:00
geometry_utils.h Don't assume an error location for PAD::GetEffectivePolygon(). 2023-10-13 13:59:26 +01:00
oval.h Fix oval pad snapping 2023-09-06 21:33:45 +01:00
polygon_triangulation.h Add a cache for TrueType contours and triangulation data. 2024-02-23 16:53:29 +01:00
seg.h Performance enhancement. 2023-12-27 13:52:02 +00:00
shape.h Fix SHAPE::Distance warnings 2023-08-22 08:30:47 -04:00
shape_arc.h Better support for arcs in tuning patterns. 2024-01-31 23:38:05 +03:00
shape_circle.h Lift some point-vs-shape APIs into SHAPE base class 2023-08-17 08:02:14 -04:00
shape_compound.h Fix SHAPE::Distance warnings 2023-08-22 08:30:47 -04:00
shape_file_io.h KiCad internal library header file housekeeping. 2021-07-01 13:46:38 -04:00
shape_index.h router: hole as first class objects, wip 2023-04-11 15:51:00 +01:00
shape_index_list.h More NULL expunging. 2021-07-18 14:31:55 -04:00
shape_line_chain.h SHAPE_LINE_CHAIN: Move .h definitions to .cpp 2024-03-02 12:09:09 +00:00
shape_null.h Lift some point-vs-shape APIs into SHAPE base class 2023-08-17 08:02:14 -04:00
shape_poly_set.h Fix triangulationValid check race for zone fill 2024-03-14 22:26:23 +00:00
shape_rect.h Lift some point-vs-shape APIs into SHAPE base class 2023-08-17 08:02:14 -04:00
shape_segment.h Lift some point-vs-shape APIs into SHAPE base class 2023-08-17 08:02:14 -04:00
shape_simple.h Lift some point-vs-shape APIs into SHAPE base class 2023-08-17 08:02:14 -04:00