mirror of https://github.com/KLayout/klayout.git
Bugfix: threading issue - multiple threads accessed the same object
This commit is contained in:
parent
379a22c86a
commit
d2478881b5
|
|
@ -123,7 +123,7 @@ static bool shields_interaction (const db::EdgePair &ep, const P &poly)
|
|||
|
||||
template <class TS, class TI>
|
||||
check_local_operation<TS, TI>::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<TS, TI>::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<std::unordered_set<db::EdgePair> > 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<TS> poly_check (edge_check);
|
||||
|
||||
std::list<TS> heap;
|
||||
std::unordered_set<TI> polygons;
|
||||
|
|
@ -248,9 +248,9 @@ check_local_operation<TS, TI>::do_compute_local (db::Layout *layout, const shape
|
|||
for (typename shape_interactions<TS, TI>::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<TS, TI>::do_compute_local (db::Layout *layout, const shape
|
|||
n = 1;
|
||||
for (typename std::unordered_set<TI>::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<TS, TI>::do_compute_local (db::Layout *layout, const shape
|
|||
n = 1;
|
||||
for (std::set<unsigned int>::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<TS, TI>::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<TS, TI>::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<TS, TI>::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"
|
||||
|
|
|
|||
|
|
@ -219,7 +219,6 @@ private:
|
|||
bool m_has_other;
|
||||
bool m_other_is_merged;
|
||||
db::RegionCheckOptions m_options;
|
||||
mutable poly2poly_check<TS> m_poly_check;
|
||||
};
|
||||
|
||||
typedef check_local_operation<db::PolygonRef, db::PolygonRef> CheckLocalOperation;
|
||||
|
|
|
|||
Loading…
Reference in New Issue