kicad/libs/kimath/src
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
..
geometry Fix triangulationValid check race for zone fill 2024-03-14 22:26:23 +00:00
math Don't show integer overflow errors in release builds. 2023-10-28 15:06:32 -04:00
bezier_curves.cpp Outline font performance improvements. 2023-05-27 01:35:40 +01:00
convert_basic_shapes_to_polygon.cpp TransformOvalToPolygon: make segments align at 45 deg angles. 2023-11-06 14:50:40 +03:00
md5_hash.cpp Silence uint32 to uint8 cast warning 2023-08-17 22:27:15 -04:00
transform.cpp Transform is right at home in kimath 2023-09-07 18:03:33 -04:00
trigo.cpp Fix issue in CalcArcCenter( VECTOR2D& aStart, VECTOR2D& aMid, VECTOR2D& aEnd ) 2023-11-18 20:08:26 +01:00