13 ms·
It's obviously subjective, but it looks like as any other indented block. Named "lock" and "unlock" operations are more explicit to me. Another potential disad
by amadvance 3y ago
It's obviously subjective, but it looks like as any other indented block. Named "lock" and "unlock" operations are more explicit to me.
Another potential disadvantage, is that you lose the possibility to control the unlock order, when you have multiple nested locks.
- gpderetta 3y agoAn indented scope (that starts with a scoped_lock or some appropriately named function) is more explicit than lock/unlock calls interspersed in the code. std::scoped_lock allows locking multiple locks.