I have been asked this question in my recent interview...

"How can we make sure that only one thread access global variable?"

What's the appropriate answer.


Thanks all