Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[S4U] Initialize s4u::Barrier in initializer list
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 5 Jul 2018 12:19:44 +0000 (14:19 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 5 Jul 2018 13:21:14 +0000 (15:21 +0200)
src/s4u/s4u_Barrier.cpp

index 482a164..cd11176 100644 (file)
@@ -17,10 +17,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_barrier, "S4U barrier");
 namespace simgrid {
 namespace s4u {
 
-Barrier::Barrier(unsigned int count) : expected_processes_(count)
+Barrier::Barrier(unsigned int expected_processes) : mutex_(Mutex::create()), cond_(ConditionVariable::create()), expected_processes_(expected_processes)
 {
-  mutex_ = Mutex::create();
-  cond_  = ConditionVariable::create();
 }
 
 /**