From: Arnaud Giersch Date: Tue, 2 Jul 2019 13:47:05 +0000 (+0200) Subject: Replace some calls to THROWF. X-Git-Tag: v3.23.2~39 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/33a0823f281a06c8637eb7ef2ca9d37bf110a17d?ds=sidebyside Replace some calls to THROWF. --- diff --git a/src/kernel/activity/MutexImpl.cpp b/src/kernel/activity/MutexImpl.cpp index 281cca447c..25a0c7771b 100644 --- a/src/kernel/activity/MutexImpl.cpp +++ b/src/kernel/activity/MutexImpl.cpp @@ -63,13 +63,9 @@ bool MutexImpl::try_lock(actor::ActorImpl* issuer) 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 */ diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index ff008bafaa..d38f868815 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -88,7 +88,7 @@ HostImpl::~HostImpl() 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; diff --git a/teshsuite/msg/app-bittorrent/bittorrent-peer.c b/teshsuite/msg/app-bittorrent/bittorrent-peer.c index afb693663c..308a7b8392 100644 --- a/teshsuite/msg/app-bittorrent/bittorrent-peer.c +++ b/teshsuite/msg/app-bittorrent/bittorrent-peer.c @@ -626,9 +626,8 @@ void update_choked_peers(peer_t peer) 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");