summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-06 17:56:20 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-06 17:56:20 +0000
commitb1244c0df8105b0d52de797ad4d6ec3d56449d0b (patch)
treef972df246e3b5a1e7b5ee4b15c4d5568a107c358
parent4c5123ff11662cb3b9b909a8b513639653be4141 (diff)
parent3b83c563f5a9992b2eb9a82738e6eebbe471b3e4 (diff)
Merge of thread_local_no_static branch
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@1934 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 6d7d3fb13b5c480c53b236a502b447902504445c
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h3
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
index bc8099e6..b3339b7d 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
@@ -300,8 +300,7 @@ class Persistent_cohomology {
// with multiplicity. We used to sum the coefficients directly in
// annotations_in_boundary by using a map, we now do it later.
typedef std::pair<Column *, int> annotation_t;
- // Danger: not thread-safe!
- static std::vector<annotation_t> annotations_in_boundary;
+ thread_local std::vector<annotation_t> annotations_in_boundary;
annotations_in_boundary.clear();
int sign = 1 - 2 * (dim_sigma % 2); // \in {-1,1} provides the sign in the
// alternate sum in the boundary.
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index 63e3f0e5..317bce23 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -1029,7 +1029,7 @@ class Simplex_tree {
Dictionary_it next = siblings->members().begin();
++next;
- static std::vector<std::pair<Vertex_handle, Node> > inter; // static, not thread-safe.
+ thread_local std::vector<std::pair<Vertex_handle, Node> > inter;
for (Dictionary_it s_h = siblings->members().begin();
s_h != siblings->members().end(); ++s_h, ++next) {
Simplex_handle root_sh = find_vertex(s_h->first);