I am setting a variable in a thread, and I'm checking using it for a condition in another thread.
I'm aware of the race condition here. But not sure if doing the set in atomic way will be enough.
Can you please let me know how to solve this in objective-c.
UPDATE: Please also let me know how to do it for a global variable.