- // Atomic operation! Do not split in two instructions!
- auto previous = (process->refcount_)++;
- xbt_assert(previous != 0);
- (void) previous;
+ // std::memory_order_relaxed ought to be enough here instead of std::memory_order_seq_cst
+ // But then, we have a threading issue when an actor commits a suicide:
+ // it seems that in this case, the worker thread kills the last occurrence of the actor
+ // while usually, the maestro does so. FIXME: we should change how actors suicide
+ process->refcount_.fetch_add(1, std::memory_order_seq_cst);