use atomic operations provided by the compiler if they are available (yay for gcc...