The motivation isn't quite as clear as commit message implies: the SessionMediator instances are all acting on the IPC thread. But it does make sense to make this threadsafe.
However, if we're going to introduce a smart RAII based lock (instead of sprinkling a few lock_guards in the access methods) I'd prefer the code using it to look nicer than:
return (**(store.lock()))[id];
If you can make that, for example: "return (*store)[id]" I'll go along.
The motivation isn't quite as clear as commit message implies: the SessionMediator instances are all acting on the IPC thread. But it does make sense to make this threadsafe.
However, if we're going to introduce a smart RAII based lock (instead of sprinkling a few lock_guards in the access methods) I'd prefer the code using it to look nicer than:
return (**(store. lock()) )[id];
If you can make that, for example: "return (*store)[id]" I'll go along.