From 6d282bbc6b789e9a4dff80e39847e8f32a2f9b8a Mon Sep 17 00:00:00 2001 From: Etienne Renault Date: Wed, 15 Mar 2017 08:44:29 +0100 Subject: [PATCH] ltsmin: update usage of brick-hashset From a discussion with Petr Rockai: "the possibly non-intuitive bit that you probably didn't notice is that the hashset is supposed to be passed to each thread by value. The copy semantics of the entire hashset are that of a shared pointer: multiple copies share the same underlying data. Each thread *must* have its own private copy of the hashset object (there are bits of state that each thread needs for bookkeeping and those must not be shared)." * spot/ltsmin/ltsmin.cc: here. --- spot/ltsmin/ltsmin.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spot/ltsmin/ltsmin.cc b/spot/ltsmin/ltsmin.cc index 22956b9d9..2e350d679 100644 --- a/spot/ltsmin/ltsmin.cc +++ b/spot/ltsmin/ltsmin.cc @@ -1237,7 +1237,7 @@ namespace spot { cspins_state_manager* manager; // The state manager std::vector* succ; // The successors of a state - cspins_state_map* map; + cspins_state_map map; // Must be a copy! int* compressed_; int* uncompressed_; int default_value_; @@ -1266,7 +1266,7 @@ namespace spot { successors_.reserve(10); inner.manager = &manager; - inner.map = ↦ + inner.map = map; inner.succ = &successors_; inner.default_value_ = defvalue; inner.compress = compress; @@ -1285,7 +1285,7 @@ namespace spot cspins_state s = inner->manager->alloc_setup(dst, inner->compressed_, inner->manager->size() * 2); - auto it = inner->map->insert(s); + auto it = inner->map.insert(s); inner->succ->push_back(*it); if (!it.isnew()) inner->manager->dealloc(s); @@ -1317,7 +1317,7 @@ namespace spot successors_.clear(); inner.manager = &manager; inner.succ = &successors_; - inner.map = ↦ + inner.map = map; inner.default_value_ = defvalue; inner.compress = compress; inner.selfloopize = selfloopize; @@ -1335,7 +1335,7 @@ namespace spot cspins_state s = inner->manager->alloc_setup(dst, inner->compressed_, inner->manager->size() * 2); - auto it = inner->map->insert(s); + auto it = inner->map.insert(s); inner->succ->push_back(*it); if (!it.isnew()) inner->manager->dealloc(s);