Like I said, there are implementations already that you can install (there's also been stuff in P99, and Google turns up others, like your example), and I noted that GCC has built-ins for atomics. I didn't go into the older implementation that wasn't universal for every architecture and wasn't used by end applications because that wasn't really its purpose. C11 by contrast isn't a hack, it's a standard that is supposed to be used universally.