]> AND Private Git Repository - loba.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
xbt_cond_timedwait: mutex is not held on timeout.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 30 Apr 2018 09:52:58 +0000 (11:52 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 30 Apr 2018 09:52:58 +0000 (11:52 +0200)
messages.cpp

index 39c4f0fb44ebda7afbd04e38ed27106cbc92b5e6..547a29f6e26d56bc95ab5d2ee2d8a63bf5cd2fb9 100644 (file)
@@ -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<message*>(MSG_task_get_data(task));
     from = MSG_task_get_source(task);