There are missing assertions which can be added later. Main point is to provide a dedicated file with common routines like incrementing only if not zero. I don't have a good name for the file so named it atomic_common2.h temporarily. It would be included at the end of md-specific atomic.h files after all base routines are provided.
Separately I'm going to convert all plain loads to atomic_load_int.