I find the ability to drop in a null_mutex (currently boost::interprocess::null_mutex) very useful when I don’t want the synchronization overhead in some cases and a real mutex in others.
I am trying to use the new c++11 mutex classes, but I see no equivalent for null_mutex – which leaves me puzzled..
Yes I know it’s trivial to implement (or I can continue to use boost, but where possible I’m trying to stick the standard and seems like a small omission?)
You can make this fairly trivially, by creating a ‘null’ implementation of the
Lockableconcept:This would work with std::lock_guard: