Lock and swap