From: Martin Quinson Date: Mon, 12 Sep 2016 20:41:13 +0000 (+0200) Subject: Merge pull request #114 from adfaure/master X-Git-Tag: v3_14~406 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/42c705df3a3f4ccbd742c08d64487b736d7e1c34?hp=702abac1553aec3866f9cc025e0343e892e23861 Merge pull request #114 from adfaure/master fix segmentation fault when process try to unlock a not locked mutex --- diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 782547113b..b1a6485584 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -163,6 +163,8 @@ bool Mutex::try_lock(smx_actor_t issuer) void Mutex::unlock(smx_actor_t issuer) { XBT_IN("(%p, %p)", this, issuer); + if(!this->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 != this->owner)