From: Arnaud Giersch Date: Mon, 30 Apr 2018 09:52:58 +0000 (+0200) Subject: xbt_cond_timedwait: mutex is not held on timeout. X-Git-Tag: sg_v3_7_1~5 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/4878eece18057b563452421a54979f7f11bad8fb?ds=sidebyside;hp=1789eecd7c4b239e5a521231387b9d30731cdf64 xbt_cond_timedwait: mutex is not held on timeout. --- diff --git a/messages.cpp b/messages.cpp index 39c4f0f..547a29f 100644 --- a/messages.cpp +++ b/messages.cpp @@ -78,9 +78,6 @@ bool message_queue::pop(message*& msg, msg_host_t& from, double timeout) else cond.wait(mutex); } - TRY_CLEANUP { - mutex.release(); - } CATCH (e) { if (e.category != timeout_error) RETHROW; @@ -89,9 +86,8 @@ bool message_queue::pop(message*& msg, msg_host_t& from, double timeout) } bool pop_was_successful = queue.try_pop(task); xbt_assert(pop_was_successful); - } else { - mutex.release(); } + mutex.release(); } msg = static_cast(MSG_task_get_data(task)); from = MSG_task_get_source(task);