+
+ if (cond->mutex == nullptr)
+ XBT_WARN("No mutex was associated so far with condition variable %p. Safety checks skipped.", cond);
+ else {
+ auto* owner = static_cast<sg4::Mutex*>(cond->mutex)->get_owner();
+ if (owner == nullptr)
+ XBT_WARN("The mutex associated to condition %p is not currently owned by anyone when calling "
+ "pthread_cond_broadcast(). The signal could get lost.",
+ cond);
+ else if (owner != simgrid::s4u::Actor::self())
+ XBT_WARN("The mutex associated to condition %p is currently owned by %s, not by the thread currently calling "
+ "calling pthread_cond_broadcast(). The signal could get lost.",
+ cond, owner->get_cname());
+ }
+