Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change the way VMs are created.
[simgrid.git] / src / s4u / s4u_Barrier.cpp
index e4a8214ab0bf65e215974f5d3502c89c4ceee169..ff34621de70c4fbf591b214da5ffca31802fe287 100644 (file)
@@ -3,14 +3,9 @@
 /* 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. */
 
-#include <exception>
-#include <mutex>
-
-#include "simgrid/Exception.hpp"
-#include "simgrid/barrier.h"
-#include "simgrid/s4u/Barrier.hpp"
-#include "simgrid/simix.h"
-#include "xbt/log.hpp"
+#include <simgrid/barrier.h>
+#include <simgrid/s4u/Barrier.hpp>
+#include <xbt/log.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_barrier, s4u, "S4U barrier");
 
@@ -39,8 +34,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;
   }