Raytheon Interview Question

How would you prevent two threads from accessing and modifying the same data at the same time?