add a spin lock on read and write