If the lock is protecting m_groups, then it seems to me that the iterator here is going to be unsafe once you return from CreateChannelEpgs() ?