If lock calls include a memory barrier, which they should, then they cannot be reordered.
Edit: Your code has undefined behavior, unless the two pointers point to the same object, which is unlikely in a realistic example.
Edit: Your code has undefined behavior, unless the two pointers point to the same object, which is unlikely in a realistic example.
It is defined behavior to read the bytes of any object using unsigned char.