
14 Nov
2007
14 Nov
'07
4:01 p.m.
On Nov 14, 2007, at 10:23 AM, Phil Endecott wrote:
I note that N2447 and your code have some swap functions for locks. Are these atomic? Also operator=. (I don't think they are.)
No. locks are not intended to be referenced by more than one thread. Only the mutex lock, try_lock, timed_lock and unlock functions are intended to be referenced simultaneously by multiple threads. The swap on locks does absolutely nothing to the referenced mutexes. It simply swaps mutex references and ownership status among the locks. Move assignment is similar except that it will call unlock() on any currently referenced mutex if need be prior to the ownership transfer from the source. -Howard