From d2478881b50507b3ca9b2dd65ea5a5213848cae0 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 10 Nov 2021 22:30:32 +0100 Subject: [PATCH] Bugfix: threading issue - multiple threads accessed the same object --- src/db/db/dbRegionLocalOperations.cc | 26 +++++++++++++------------- src/db/db/dbRegionLocalOperations.h | 1 - 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/db/db/dbRegionLocalOperations.cc b/src/db/db/dbRegionLocalOperations.cc index ac873dc06..6c14bc5d1 100644 --- a/src/db/db/dbRegionLocalOperations.cc +++ b/src/db/db/dbRegionLocalOperations.cc @@ -123,7 +123,7 @@ static bool shields_interaction (const db::EdgePair &ep, const P &poly) template check_local_operation::check_local_operation (const EdgeRelationFilter &check, bool different_polygons, bool has_other, bool other_is_merged, const db::RegionCheckOptions &options) - : m_check (check), m_different_polygons (different_polygons), m_has_other (has_other), m_other_is_merged (other_is_merged), m_options (options), m_poly_check () + : m_check (check), m_different_polygons (different_polygons), m_has_other (has_other), m_other_is_merged (other_is_merged), m_options (options) { // .. nothing yet .. } @@ -206,7 +206,7 @@ check_local_operation::do_compute_local (db::Layout *layout, const shape bool symmetric_edge_pairs = ! m_has_other && m_options.opposite_filter == db::NoOppositeFilter && m_options.rect_filter == RectFilter::NoRectFilter; edge2edge_check_negative_or_positive > edge_check (m_check, result, intra_polygon_result, m_options.negative, m_different_polygons, m_has_other, m_options.shielded, symmetric_edge_pairs); - m_poly_check.connect (edge_check); + poly2poly_check poly_check (edge_check); std::list heap; std::unordered_set polygons; @@ -248,9 +248,9 @@ check_local_operation::do_compute_local (db::Layout *layout, const shape for (typename shape_interactions::iterator i = interactions.begin (); i != interactions.end (); ++i) { const TS &subject = interactions.subject_shape (i->first); if (! take_all) { - m_poly_check.enter (subject, n, common_box); + poly_check.enter (subject, n, common_box); } else { - m_poly_check.enter (subject, n); + poly_check.enter (subject, n); } n += 2; } @@ -290,9 +290,9 @@ check_local_operation::do_compute_local (db::Layout *layout, const shape n = 1; for (typename std::unordered_set::const_iterator o = polygons.begin (); o != polygons.end (); ++o) { if (! take_all) { - m_poly_check.enter (*o, n, common_box); + poly_check.enter (*o, n, common_box); } else { - m_poly_check.enter (*o, n); + poly_check.enter (*o, n); } n += 2; } @@ -302,9 +302,9 @@ check_local_operation::do_compute_local (db::Layout *layout, const shape n = 1; for (std::set::const_iterator id = ids.begin (); id != ids.end (); ++id) { if (! take_all) { - m_poly_check.enter (interactions.intruder_shape (*id).second, n, common_box); + poly_check.enter (interactions.intruder_shape (*id).second, n, common_box); } else { - m_poly_check.enter (interactions.intruder_shape (*id).second, n); + poly_check.enter (interactions.intruder_shape (*id).second, n); } n += 2; } @@ -322,9 +322,9 @@ check_local_operation::do_compute_local (db::Layout *layout, const shape const TS &ts = interactions.subject_shape (i->first); insert_into_hash (polygons, ts); if (! take_all) { - m_poly_check.enter (ts, n, common_box); + poly_check.enter (ts, n, common_box); } else { - m_poly_check.enter (ts, n); + poly_check.enter (ts, n); } n += 2; } @@ -335,9 +335,9 @@ check_local_operation::do_compute_local (db::Layout *layout, const shape const TI &ti = interactions.intruder_shape (*id).second; if (polygons.find (ti) == polygons.end ()) { if (! take_all) { - m_poly_check.enter (ti, n, common_box); + poly_check.enter (ti, n, common_box); } else { - m_poly_check.enter (ti, n); + poly_check.enter (ti, n); } n += 2; } @@ -346,7 +346,7 @@ check_local_operation::do_compute_local (db::Layout *layout, const shape } do { - m_poly_check.process (); + poly_check.process (); } while (edge_check.prepare_next_pass ()); // detect and remove parts of the result which have or do not have results "opposite" diff --git a/src/db/db/dbRegionLocalOperations.h b/src/db/db/dbRegionLocalOperations.h index b8f8b8b3f..40ca85057 100644 --- a/src/db/db/dbRegionLocalOperations.h +++ b/src/db/db/dbRegionLocalOperations.h @@ -219,7 +219,6 @@ private: bool m_has_other; bool m_other_is_merged; db::RegionCheckOptions m_options; - mutable poly2poly_check m_poly_check; }; typedef check_local_operation CheckLocalOperation;