From 686f15ae4f0c671608fe2109678787fc1b7f4415 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Thu, 6 Feb 2020 16:47:50 +0100 Subject: [PATCH] Refs #7478. Protecting against spurious wakeup --- src/cpp/rtps/messages/SendBuffersManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpp/rtps/messages/SendBuffersManager.cpp b/src/cpp/rtps/messages/SendBuffersManager.cpp index ff4218723fd..9b9215128b1 100644 --- a/src/cpp/rtps/messages/SendBuffersManager.cpp +++ b/src/cpp/rtps/messages/SendBuffersManager.cpp @@ -80,7 +80,7 @@ std::unique_ptr SendBuffersManager::get_buffer( std::unique_ptr ret_val; - if (pool_.empty()) + while (pool_.empty()) { if (allow_growing_ || n_created_ < pool_.capacity()) { @@ -88,8 +88,8 @@ std::unique_ptr SendBuffersManager::get_buffer( } else { + logInfo(RTPS_PARTICIPANT, "Waiting for send buffer"); available_cv_.wait(lock); - assert(!pool_.empty()); } }