Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid TSan false positives.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 21 Jan 2019 11:57:01 +0000 (12:57 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 21 Jan 2019 14:35:58 +0000 (15:35 +0100)
src/kernel/context/ContextSwapped.cpp

index 100dcba..3c89743 100644 (file)
@@ -52,7 +52,7 @@ SwappedContext::SwappedContext(std::function<void()> code, void_pfn_smxprocess_t
     : Context(std::move(code), cleanup_func, process), factory_(factory)
 {
   // Save maestro (=context created first) in preparation for run_all
-  if (factory_->workers_context_[0] == nullptr)
+  if (not factory->parallel_ && factory_->workers_context_[0] == nullptr)
     factory_->workers_context_[0] = this;
 
   if (has_code()) {