- if (factory_->parallel_) {
- // Save the thread number (my body) in an os-thread-specific area
- worker_id_ = factory_->threads_working_.fetch_add(1, std::memory_order_relaxed);
- // Save my current soul (either maestro, or one of the minions) in a permanent area
- SwappedContext* worker_context = static_cast<SwappedContext*>(self());
- factory_->workers_context_[worker_id_] = worker_context;
+ if (SIMIX_context_is_parallel()) {
+ // Save my current soul (either maestro, or one of the minions) in a thread-specific area
+ worker_context_ = static_cast<SwappedContext*>(self());