Juan Carlos Franzoy <jfranzoy@xxxxxxxxxxxx> writes: > Hello. I write because I was wondering if __exchange_and_add can be used from user code or it's an internal detail of libstdc++. > > I have to implement a library with AtomicSet and AtomicAdd. The library must be portable across solaris/sparc, linux/x86 and hpux11/parisc. > > If the answer is no, do anybody know how to do it? gcc provides these calls as extensions: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html Ian