Question: **UPDATED:** Is there a thread-safe, lock-free and available on all Linux distros *increment* function available in C or C++ ?

Answer: 
GLib has functions to do this. You might check out [<http://library.gnome.org/devel/glib/stable/glib-Atomic-Operations.html>](http://library.gnome.org/devel/glib/stable/glib-Atomic-Operations.html)

Specifically, it sounds like you want g\_atomic\_int\_inc()
The current C and C++ standards don't define such a thing. Your implementation may well have one.