XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_synchro, simix,
"SIMIX Synchronization (mutex, semaphores and conditions)");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_synchro, simix,
"SIMIX Synchronization (mutex, semaphores and conditions)");
{
XBT_IN("(%p, %f)",smx_host,timeout);
{
XBT_IN("(%p, %f)",smx_host,timeout);
sync->sleep = surf_host_sleep(smx_host, timeout);
sync->sleep->setData(sync);
XBT_OUT();
sync->sleep = surf_host_sleep(smx_host, timeout);
sync->sleep->setData(sync);
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;
+}
+
if (count == 0) {
xbt_assert(xbt_swag_size(cond->sleeping) == 0,
"Cannot destroy conditional since someone is still using it");
if (count == 0) {
xbt_assert(xbt_swag_size(cond->sleeping) == 0,
"Cannot destroy conditional since someone is still using it");