Changeset 9ac3d3 for ThirdParty/CodePatterns/src/Observer/Notification.cpp
- Timestamp:
- Jul 19, 2018, 2:39:51 PM (7 years ago)
- Branches:
- Candidate_v1.6.1
- Children:
- 209f4c
- Parents:
- ca2880
- git-author:
- Frederik Heber <frederik.heber@…> (07/19/18 14:39:04)
- git-committer:
- Frederik Heber <frederik.heber@…> (07/19/18 14:39:51)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ThirdParty/CodePatterns/src/Observer/Notification.cpp
rca2880 r9ac3d3 52 52 void Notification::notifyAll(Observable * const publisher) 53 53 { 54 boost::recursive_mutex::scoped_lock guard(TargetsLock); 55 // copy such that signOff() within receiving update() does not affect iterating 56 // this is because within the same thread and with the update() signOff() may be 57 // called and when executed it modifies targets 58 targets_t temp_targets = targets; 54 targets_t temp_targets; 55 { 56 boost::recursive_mutex::scoped_lock guard(TargetsLock); 57 // copy such that signOff() within receiving update() does not affect iterating 58 // this is because within the same thread and with the update() signOff() may be 59 // called and when executed it modifies targets 60 temp_targets = targets; 61 } 59 62 for(targets_t::iterator it=temp_targets.begin(); 60 63 it!=temp_targets.end();++it){
Note:
See TracChangeset
for help on using the changeset viewer.