Example of how to use boost upgradeable mutexes
问题 I have a multithreaded server application that needs mutex locks over some shared memory. The shared memory are basically sTL maps etc. Much of the time I'm just reading from the map. But, I also need to occasionally add to it. e.g. typedef std::map MessageMap; MessageMap msgmap; boost:shared_mutex access_; void ProcessMessage(Message* message) { // Access message... read some stuff from it message->... UUID id = message->GetSessionID(); // Need to obtain a lock here. (shared lock? multiple