Synchronization primitives (such as semaphores, mutexes, etc.) are provided by OS-specific libraries, and not in the language itself. C/C++ have no intrinsic "synchronized" keyword.
If you're programming on Linux, look at Posix threads or the Boost library:
http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
If you're programming on native Windows Win32 (Win98 or higher), you can use APIs like EnterCriticalSection() and InterlockedAdd(), among others:
http://msdn.microsoft.com/en-us/library/ms686353%28v=VS.85%29.aspx
If you're programming Windows with .Net, however, you're back to synchronization primitives being part of the standard .Net libraries:
http://msdn.microsoft.com/en-us/library/ms173179.aspx
'Hope that helps .. PSM