I have currently created a C++ class for a thread safe integer which simply stores an integer privately and has public get a set functions which use a boost::mutex to ensure tha
you can also have a look at the atomic ops section of intels Thread Building Blocks or the atomic_ops project