Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
changing type of offset parameter in file_seek from sg_size_t to the
[simgrid.git] / src / xbt / xbt_sg_synchro.c
index e04f5a1..724755b 100644 (file)
@@ -204,16 +204,21 @@ xbt_bar_t xbt_barrier_init(unsigned int count)
 }
 
 
-void xbt_barrier_wait(xbt_bar_t bar)
+int xbt_barrier_wait(xbt_bar_t bar)
 {
+   int ret=0;
    xbt_mutex_acquire(bar->mutex);
    if (++bar->arrived_processes == bar->expected_processes) {
      xbt_cond_broadcast(bar->cond);
      xbt_mutex_release(bar->mutex);
+     ret=XBT_BARRIER_SERIAL_PROCESS;
+     bar->arrived_processes = 0;
    } else {
      xbt_cond_wait(bar->cond, bar->mutex);
      xbt_mutex_release(bar->mutex);
    }
+
+   return ret;
 }
 
 void xbt_barrier_destroy(xbt_bar_t bar)