@@ -524,6 +524,8 @@ bool EDP::unpairWriterProxy(
524524 MatchingInfo info;
525525 info.status = REMOVED_MATCHING;
526526 info.remoteEndpointGuid = writer_guid;
527+
528+ std::lock_guard<RecursiveTimedMutex> lock (r.getMutex ());
527529 listener->on_reader_matched (&r, info);
528530 }
529531 }
@@ -559,6 +561,7 @@ bool EDP::unpairReaderProxy(
559561 MatchingInfo info;
560562 info.status = REMOVED_MATCHING;
561563 info.remoteEndpointGuid = reader_guid;
564+ std::lock_guard<RecursiveTimedMutex> lock (w.getMutex ());
562565 listener->on_writer_matched (&w, info);
563566 }
564567 }
@@ -868,6 +871,7 @@ bool EDP::pairingReader(
868871 MatchingInfo info;
869872 info.status = MATCHED_MATCHING;
870873 info.remoteEndpointGuid = writer_guid;
874+ std::lock_guard<RecursiveTimedMutex> lock (reader->getMutex ());
871875 reader->get_listener ()->on_reader_matched (reader, info);
872876 }
873877 }
@@ -896,6 +900,7 @@ bool EDP::pairingReader(
896900 MatchingInfo info;
897901 info.status = REMOVED_MATCHING;
898902 info.remoteEndpointGuid = writer_guid;
903+ std::lock_guard<RecursiveTimedMutex> lock (reader->getMutex ());
899904 reader->get_listener ()->on_reader_matched (reader, info);
900905 }
901906 }
@@ -961,6 +966,7 @@ bool EDP::pairingWriter(
961966 MatchingInfo info;
962967 info.status = MATCHED_MATCHING;
963968 info.remoteEndpointGuid = reader_guid;
969+ std::lock_guard<RecursiveTimedMutex> lock (writer->getMutex ());
964970 writer->get_listener ()->on_writer_matched (writer, info);
965971 }
966972 }
@@ -986,6 +992,7 @@ bool EDP::pairingWriter(
986992 MatchingInfo info;
987993 info.status = REMOVED_MATCHING;
988994 info.remoteEndpointGuid = reader_guid;
995+ std::lock_guard<RecursiveTimedMutex> lock (writer->getMutex ());
989996 writer->get_listener ()->on_writer_matched (writer, info);
990997 }
991998 }
@@ -1037,6 +1044,7 @@ bool EDP::pairing_reader_proxy_with_any_local_writer(
10371044 MatchingInfo info;
10381045 info.status = MATCHED_MATCHING;
10391046 info.remoteEndpointGuid = reader_guid;
1047+ std::lock_guard<RecursiveTimedMutex> lock (w.getMutex ());
10401048 w.get_listener ()->on_writer_matched (&w, info);
10411049 }
10421050 }
@@ -1063,6 +1071,7 @@ bool EDP::pairing_reader_proxy_with_any_local_writer(
10631071 MatchingInfo info;
10641072 info.status = REMOVED_MATCHING;
10651073 info.remoteEndpointGuid = reader_guid;
1074+ std::lock_guard<RecursiveTimedMutex> lock (w.getMutex ());
10661075 w.get_listener ()->on_writer_matched (&w, info);
10671076 }
10681077 }
@@ -1130,6 +1139,7 @@ bool EDP::pairing_reader_proxy_with_local_writer(
11301139 MatchingInfo info;
11311140 info.status = REMOVED_MATCHING;
11321141 info.remoteEndpointGuid = reader_guid;
1142+ std::lock_guard<RecursiveTimedMutex> lock (w.getMutex ());
11331143 w.get_listener ()->on_writer_matched (&w, info);
11341144 }
11351145 }
@@ -1172,6 +1182,7 @@ bool EDP::pairing_remote_reader_with_local_writer_after_security(
11721182 MatchingInfo info;
11731183 info.status = MATCHED_MATCHING;
11741184 info.remoteEndpointGuid = reader_guid;
1185+ std::lock_guard<RecursiveTimedMutex> lock (w.getMutex ());
11751186 w.get_listener ()->on_writer_matched (&w, info);
11761187 }
11771188 }
@@ -1230,6 +1241,7 @@ bool EDP::pairing_writer_proxy_with_any_local_reader(
12301241 MatchingInfo info;
12311242 info.status = MATCHED_MATCHING;
12321243 info.remoteEndpointGuid = writer_guid;
1244+ std::lock_guard<RecursiveTimedMutex> lock (r.getMutex ());
12331245 r.get_listener ()->on_reader_matched (&r, info);
12341246 }
12351247 }
@@ -1256,6 +1268,7 @@ bool EDP::pairing_writer_proxy_with_any_local_reader(
12561268 MatchingInfo info;
12571269 info.status = REMOVED_MATCHING;
12581270 info.remoteEndpointGuid = writer_guid;
1271+ std::lock_guard<RecursiveTimedMutex> lock (r.getMutex ());
12591272 r.get_listener ()->on_reader_matched (&r, info);
12601273 }
12611274 }
@@ -1323,6 +1336,7 @@ bool EDP::pairing_writer_proxy_with_local_reader(
13231336 MatchingInfo info;
13241337 info.status = REMOVED_MATCHING;
13251338 info.remoteEndpointGuid = writer_guid;
1339+ std::lock_guard<RecursiveTimedMutex> lock (r.getMutex ());
13261340 r.get_listener ()->on_reader_matched (&r, info);
13271341 }
13281342 }
@@ -1367,6 +1381,7 @@ bool EDP::pairing_remote_writer_with_local_reader_after_security(
13671381 MatchingInfo info;
13681382 info.status = MATCHED_MATCHING;
13691383 info.remoteEndpointGuid = writer_guid;
1384+ std::lock_guard<RecursiveTimedMutex> lock (r.getMutex ());
13701385 r.get_listener ()->on_reader_matched (&r, info);
13711386
13721387 }
0 commit comments