Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Set shared variable *before* mutex unlock.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 31 May 2021 21:20:24 +0000 (23:20 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 1 Jun 2021 13:32:21 +0000 (15:32 +0200)
src/s4u/s4u_Barrier.cpp

index e4a8214..f1e449b 100644 (file)
@@ -39,8 +39,8 @@ int Barrier::wait()
   XBT_DEBUG("waiting %p %u/%u", this, arrived_actors_, expected_actors_);
   if (arrived_actors_ == expected_actors_) {
     cond_->notify_all();
-    mutex_->unlock();
     arrived_actors_ = 0;
+    mutex_->unlock();
     return SG_BARRIER_SERIAL_THREAD;
   }