Mutex locks - where the sets could have been built by merging
问题 From here: https://stackoverflow.com/a/5524120/462608 If you want to lock several mutex-protected objects from a set of such objects, where the sets could have been built by merging , you can choose to use per object exactly one mutex, allowing more threads to work in parallel, or to use per object one reference to any possibly shared recursive mutex, to lower the probability of failing to lock all mutexes together, or to use per object one comparable reference to any possibly shared non