Commit 0d8112a0 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix a race condition in label_parallel_edges()

This fixes a race condition when undirected graphs are used, and when
OpenMP is enabled.
parent 736d6910
......@@ -17,6 +17,7 @@
#include <tr1/unordered_set>
#include "graph_util.hh"
namespace graph_tool
......@@ -49,6 +50,12 @@ struct label_parallel_edges
if (p_edges.find(*e1) != p_edges.end())
// do not visit edges twice in undirected graphs
if (!is_directed::apply<Graph>::type::value &&
target(*e1, g) < v)
size_t n = 0;
put(parallel, *e1, n);
for (tie(e2, e_end2) = out_edges(v, g); e2 != e_end2; ++e2)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment