Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
better check for mpi_datatype_null
[simgrid.git] / src / s4u / s4u_Barrier.cpp
index d031081..f1e449b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2018-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2018-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -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;
   }