From c3ac74d4de09b362b213d3da71b476f41802feab Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 31 Aug 2016 14:05:22 +0200 Subject: [PATCH 1/3] Make variables thread local --- Snap_rounding_2/include/CGAL/Snap_rounding_2.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Snap_rounding_2/include/CGAL/Snap_rounding_2.h b/Snap_rounding_2/include/CGAL/Snap_rounding_2.h index 5bbac9affdf..2e65abe672e 100644 --- a/Snap_rounding_2/include/CGAL/Snap_rounding_2.h +++ b/Snap_rounding_2/include/CGAL/Snap_rounding_2.h @@ -32,6 +32,7 @@ #include #include #include +#include namespace CGAL { @@ -87,7 +88,14 @@ private: Segment_2 *left_seg; Segment_2 *top_seg; Segment_2 *bot_seg; - static SEG_Direction seg_dir; + + static SEG_DIR& direction() + { + CGAL_STATIC_THREAD_LOCAL_VARIABLE(SEG_Direction, seg_dir,SEG_UP); + return seg_dir; + } + + public: Hot_pixel(const Point_2 & inp_point, NT inp_pixel_size); @@ -99,12 +107,12 @@ public: bool intersect_bot(const Segment_2 & seg, SEG_Direction seg_dir) const; bool intersect_top(const Segment_2 & seg, SEG_Direction seg_dir) const; bool intersect(Segment_data & seg, SEG_Direction seg_dir) const; - void set_direction(SEG_Direction inp_seg_dir) { seg_dir = inp_seg_dir; } - SEG_Direction get_direction() const { return(seg_dir); } + void set_direction(SEG_Direction inp_seg_dir) { direction() = inp_seg_dir; } + SEG_Direction get_direction() const { return direction(); } }; /*! */ -template SEG_Direction Hot_pixel::seg_dir; +//template SEG_Direction Hot_pixel::seg_dir; // a function for compare two hot pixels for the set of hot pixels template From 16a9c384d479b093eb2c7d958dc8810291134c91 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 1 Sep 2016 12:44:37 +0200 Subject: [PATCH 2/3] typo --- Snap_rounding_2/include/CGAL/Snap_rounding_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Snap_rounding_2/include/CGAL/Snap_rounding_2.h b/Snap_rounding_2/include/CGAL/Snap_rounding_2.h index 2e65abe672e..d54e74febfe 100644 --- a/Snap_rounding_2/include/CGAL/Snap_rounding_2.h +++ b/Snap_rounding_2/include/CGAL/Snap_rounding_2.h @@ -89,7 +89,7 @@ private: Segment_2 *top_seg; Segment_2 *bot_seg; - static SEG_DIR& direction() + static SEG_Direction& direction() { CGAL_STATIC_THREAD_LOCAL_VARIABLE(SEG_Direction, seg_dir,SEG_UP); return seg_dir; From b19bfc43007934a0d830756477e50ba419372082 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 20 Sep 2016 14:41:07 +0200 Subject: [PATCH 3/3] remove instead of commenting --- Snap_rounding_2/include/CGAL/Snap_rounding_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Snap_rounding_2/include/CGAL/Snap_rounding_2.h b/Snap_rounding_2/include/CGAL/Snap_rounding_2.h index d54e74febfe..ec879779e77 100644 --- a/Snap_rounding_2/include/CGAL/Snap_rounding_2.h +++ b/Snap_rounding_2/include/CGAL/Snap_rounding_2.h @@ -112,7 +112,7 @@ public: }; /*! */ -//template SEG_Direction Hot_pixel::seg_dir; + // a function for compare two hot pixels for the set of hot pixels template