XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_mutex, simix_synchro, "Mutex kernel-space implementation");
+#if SIMGRID_HAVE_MC
+#include "simgrid/modelchecker.h"
+#include "src/mc/mc_safety.hpp"
+#define MC_CHECK_NO_DPOR() \
+ xbt_assert(not MC_is_active() || simgrid::mc::reduction_mode != simgrid::mc::ReductionMode::dpor, \
+ "Mutex is currently not supported with DPOR, use --cfg=model-check/reduction:none")
+#else
+#define MC_CHECK_NO_DPOR() (void)0
+#endif
+
namespace simgrid {
namespace kernel {
namespace activity {
void MutexImpl::lock(actor::ActorImpl* issuer)
{
XBT_IN("(%p; %p)", this, issuer);
+ MC_CHECK_NO_DPOR();
/* FIXME: check where to validate the arguments */
RawImplPtr synchro = nullptr;
bool MutexImpl::try_lock(actor::ActorImpl* issuer)
{
XBT_IN("(%p, %p)", this, issuer);
+ MC_CHECK_NO_DPOR();
if (locked_) {
XBT_OUT();
return false;
if (reductionMode_ == ReductionMode::dpor) {
auto call = state->executed_req_.call_;
const kernel::actor::ActorImpl* issuer = api::get().simcall_get_issuer(&state->executed_req_);
- if (call == simix::Simcall::MUTEX_LOCK)
- xbt_die("Mutex is currently not supported with DPOR, use --cfg=model-check/reduction:none");
-
for (auto i = stack_.rbegin(); i != stack_.rend(); ++i) {
State* prev_state = i->get();
if (state->executed_req_.issuer_ == prev_state->executed_req_.issuer_) {