Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Start to modernize the remaining old simcalls related to comms
[simgrid.git] / src / s4u / s4u_Barrier.cpp
index d031081..1bb6e23 100644 (file)
@@ -1,16 +1,11 @@
-/* Copyright (c) 2018-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2018-2022. 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. */
 
-#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;
   }