From 562e58a8aeba0a1ee0bcfb0302a4807c516679e6 Mon Sep 17 00:00:00 2001 From: Iker Luengo Date: Tue, 23 Mar 2021 15:55:42 +0100 Subject: [PATCH] Refs 10731. Protect the notification with the mutex Signed-off-by: Iker Luengo --- src/cpp/rtps/DataSharing/DataSharingNotification.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cpp/rtps/DataSharing/DataSharingNotification.hpp b/src/cpp/rtps/DataSharing/DataSharingNotification.hpp index 9cb11ca87de..639ff9cbbcf 100644 --- a/src/cpp/rtps/DataSharing/DataSharingNotification.hpp +++ b/src/cpp/rtps/DataSharing/DataSharingNotification.hpp @@ -53,7 +53,9 @@ class DataSharingNotification */ inline void notify() { + std::unique_lock lock(notification_->notification_mutex); notification_->new_data.store(true); + lock.unlock(); notification_->notification_cv.notify_all(); }