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

Private GIT Repository
xbt_cond_timedwait: mutex is not held on timeout.
[loba.git] / 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);
             }
                 else
                     cond.wait(mutex);
             }
-            TRY_CLEANUP {
-                mutex.release();
-            }
             CATCH (e) {
                 if (e.category != timeout_error)
                     RETHROW;
             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);
             }
             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);
     }
     msg = static_cast<message*>(MSG_task_get_data(task));
     from = MSG_task_get_source(task);