void MutexImpl::unlock(actor::ActorImpl* issuer)
{
XBT_IN("(%p, %p)", this, issuer);
- if (not locked_)
- THROWF(mismatch_error, 0, "Cannot release that mutex: it was not locked.");
-
- /* If the mutex is not owned by the issuer, that's not good */
- if (issuer != owner_)
- THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
- owner_->get_cname(), owner_->get_pid());
+ xbt_assert(locked_, "Cannot release that mutex: it was not locked.");
+ xbt_assert(issuer == owner_, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
+ owner_->get_cname(), owner_->get_pid());
if (not sleeping_.empty()) {
/*process to wake up */
msg += "\n\t" + std::string(process.get_name());
SIMIX_display_process_status();
- THROWF(arg_error, 0, "%s", msg.c_str());
+ xbt_die("%s", msg.c_str());
}
for (auto const& arg : actors_at_boot_)
delete arg;
i++;
}
xbt_dict_cursor_free(&cursor);
- if (peer_choosed == NULL)
- THROWF(unknown_error, 0, "A peer should have be selected at this point");
- else if ((peer_choosed->interested == 0) || (peer_choosed->choked_upload == 0))
+ xbt_assert(peer_choosed != NULL, "A peer should have been selected at this point");
+ if ((peer_choosed->interested == 0) || (peer_choosed->choked_upload == 0))
peer_choosed = NULL;
else
XBT_DEBUG("Nothing to do, keep going");