Just to clarify, delclaring a variable volatile is not a way to ensure thread safety. In essence, it just makes your program work "as expected" -- it prevents compiler optimization from hiding value changes from your program. While these unexpected changes can be the result of having multiple threads in your program, variable volatility is a separate issue from thread safety.
As Mohan pointed out, reading/writing a 32-bit int is inherently thread-safe, because the processor cannot be interrupted in the middle of a read/write. You only need to use thread-safe storage when reading/writing the data can take more than one CPU operation.
Mert A.
National Instruments