File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,11 +451,14 @@ bool DataProcessingDevice::ConditionalRun()
451451
452452 // Notify on the main thread the new region callbacks, making sure
453453 // no callback is issued if there is something still processing.
454- if (mPendingRegionInfos .empty () == false ) {
455- std::vector<FairMQRegionInfo> toBeNotified;
456- toBeNotified.swap (mPendingRegionInfos ); // avoid any MT issue.
457- for (auto const & info : toBeNotified) {
458- mServiceRegistry .get <CallbackService>()(CallbackService::Id::RegionInfoCallback, info);
454+ {
455+ std::lock_guard<std::mutex> lock (mRegionInfoMutex );
456+ if (mPendingRegionInfos .empty () == false ) {
457+ std::vector<FairMQRegionInfo> toBeNotified;
458+ toBeNotified.swap (mPendingRegionInfos ); // avoid any MT issue.
459+ for (auto const & info : toBeNotified) {
460+ mServiceRegistry .get <CallbackService>()(CallbackService::Id::RegionInfoCallback, info);
461+ }
459462 }
460463 }
461464 // Synchronous execution of the callbacks. This will be moved in the
You can’t perform that action at this time.
0 commit comments