From: Gabriel Corona Date: Mon, 20 Jun 2016 07:12:14 +0000 (+0200) Subject: Merge branch 'condvar' X-Git-Tag: v3_14~940^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/198b09ec16ca1b8fc05053bcae9e75c0ad689711?hp=-c Merge branch 'condvar' --- 198b09ec16ca1b8fc05053bcae9e75c0ad689711 diff --combined src/simix/smx_synchro.cpp index 95ff865b0f,c8ec7fe32c..2d20719e85 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@@ -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); @@@ -372,6 -372,7 +373,6 @@@ void intrusive_ptr_add_ref(s_smx_cond_t *cond) { auto previous = (cond->refcount_)++; - xbt_assert(previous != 0); (void) previous; } diff --combined tools/cmake/DefinePackages.cmake index 1e16c2e835,a22af8f060..ec842ee3e2 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@@ -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 @@@ -1074,6 -1071,7 +1076,6 @@@ 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 @@@ -1101,6 -1099,7 +1103,6 @@@ 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