Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'condvar'
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 20 Jun 2016 07:12:14 +0000 (09:12 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 20 Jun 2016 07:12:14 +0000 (09:12 +0200)
1  2 
src/simix/smx_synchro.cpp
tools/cmake/DefinePackages.cmake

@@@ -240,8 -240,7 +240,8 @@@ smx_cond_t SIMIX_cond_init(void
    smx_cond_t cond = xbt_new0(s_smx_cond_t, 1);
    cond->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
    cond->mutex = nullptr;
 -  cond->refcount_ = 1;
 +  cond->refcount_ = 0;
 +  intrusive_ptr_add_ref(cond);
    XBT_OUT();
    return cond;
  }
@@@ -352,12 -351,13 +352,13 @@@ void SIMIX_cond_broadcast(smx_cond_t co
    XBT_OUT();
  }
  
- /**
-  * \brief Destroys a condition.
-  *
-  * Destroys and frees the condition's memory. 
-  * \param cond A condition
-  */
+ smx_cond_t SIMIX_cond_ref(smx_cond_t cond)
+ {
+   if (cond != nullptr)
+     intrusive_ptr_add_ref(cond);
+   return cond;
+ }
  void SIMIX_cond_unref(smx_cond_t cond)
  {
    XBT_IN("(%p)",cond);
  void intrusive_ptr_add_ref(s_smx_cond_t *cond)
  {
    auto previous = (cond->refcount_)++;
 -  xbt_assert(previous != 0);
    (void) previous;
  }
  
@@@ -67,7 -67,6 +67,7 @@@ set(EXTRA_DIS
    src/surf/AsCluster.hpp
    src/surf/AsClusterFatTree.hpp
    src/surf/AsClusterTorus.hpp
 +  src/surf/AsClusterDragonfly.hpp
    src/surf/AsDijkstra.hpp
    src/surf/AsFloyd.hpp
    src/surf/AsFull.hpp
@@@ -293,7 -292,6 +293,7 @@@ set(SURF_SR
    src/surf/AsCluster.cpp
    src/surf/AsClusterFatTree.cpp
    src/surf/AsClusterTorus.cpp
 +  src/surf/AsClusterDragonfly.cpp
    src/surf/AsDijkstra.cpp
    src/surf/AsFloyd.cpp
    src/surf/AsFull.cpp
@@@ -384,6 -382,7 +384,7 @@@ set(S4U_SR
    src/s4u/s4u_host.cpp  
    src/s4u/s4u_mailbox.cpp
    src/s4u/s4u_mutex.cpp
+   src/s4u/s4u_conditionVariable.cpp
    src/s4u/s4u_storage.cpp
  )
  
@@@ -650,6 -649,7 +651,7 @@@ set(headers_to_instal
    include/simgrid/s4u/host.hpp  
    include/simgrid/s4u/mailbox.hpp  
    include/simgrid/s4u/mutex.hpp
+   include/simgrid/s4u/conditionVariable.hpp
    include/simgrid/s4u/storage.hpp  
    include/simgrid/s4u.h
    include/simgrid/plugins/energy.h
@@@ -1048,9 -1048,6 +1050,9 @@@ set(PLATFORMS_EXAMPLE
    examples/platforms/cluster_and_one_host.xml
    examples/platforms/cluster_prototype.lua
    examples/platforms/cluster_no_backbone.xml
 +  examples/platforms/cluster_torus.xml
 +  examples/platforms/cluster_fat_tree.xml
 +  examples/platforms/cluster_dragonfly.xml
    examples/platforms/crosstraffic.xml
    examples/platforms/optorsim/gridpp_grid_2004.conf
    examples/platforms/optorsim/lcg_sept2004_grid.conf
    examples/platforms/dogbone.xml
    examples/platforms/energy_platform.xml
    examples/platforms/faulty_host.xml
 -  examples/platforms/fat_tree_cluster.xml
    examples/platforms/g5k.xml
    examples/platforms/griffon.xml
    examples/platforms/meta_cluster.xml
    examples/platforms/syscoord/median_meridian.syscoord
    examples/platforms/syscoord/median_p2psim.syscoord
    examples/platforms/three_multicore_hosts.xml
 -  examples/platforms/torus_cluster.xml
    examples/platforms/two_clusters.xml
    examples/platforms/two_hosts.xml
    examples/platforms/two_hosts_platform_shared.xml