On 10 November 2010 22:02, Jonathan Wakely wrote: > > e.g. this fixes both deadlocks > > void swap(A& a, A& b) > { > std::mutex& m1 = get_mutex(&a); > std::mutex& m2 = get_mutex(&b); > if (&m1 < &m2) Doh, that should be &m1 == &m2, sorry.