#include "src/kernel/activity/MutexImpl.hpp"
#include "src/kernel/activity/SynchroRaw.hpp"
-#include "src/simix/smx_synchro_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_mutex, simix_synchro, "Mutex kernel-space implementation");
}
XBT_OUT();
}
-}
-}
-}
-
/** Increase the refcount for this mutex */
-smx_mutex_t SIMIX_mutex_ref(smx_mutex_t mutex)
+MutexImpl* MutexImpl::ref()
{
- if (mutex != nullptr)
- intrusive_ptr_add_ref(mutex);
- return mutex;
+ intrusive_ptr_add_ref(this);
+ return this;
}
/** Decrease the refcount for this mutex */
-void SIMIX_mutex_unref(smx_mutex_t mutex)
+void MutexImpl::unref()
{
- if (mutex != nullptr)
- intrusive_ptr_release(mutex);
+ intrusive_ptr_release(this);
}
+} // namespace activity
+} // namespace kernel
+} // namespace simgrid
+
// Simcall handlers:
void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex)