Qualcomm Interview Question

Question how to implement sw lock (spin lock) in shared memory between two CPUs