Add an Atomic portability header
authorChristopher Dykes <cdykes@fb.com>
Mon, 18 Jul 2016 16:48:58 +0000 (09:48 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Mon, 18 Jul 2016 16:53:32 +0000 (09:53 -0700)
commit9d4e81294c0486ff21f16e473addda2a306e1aad
treeb9f5981ac86ae38b46b07d94c986a72721a4ae33
parent4592f5e8e11ae6a5c3443b55ba5edb0425c5f019
Add an Atomic portability header

Summary: Because there are situations where we need to do an atomic write to a plain pointer, rather than an atomic value. Unfortunately, there is no support in the standard library for this, so different compilers implement the primitives differently. This specifically implements an `int64_t` overload for `__sync_fetch_and_add` for use in the atomic hash map test.

Reviewed By: yfeldblum

Differential Revision: D3571830

fbshipit-source-id: c27d8d2a5238bbc9aba6a9e48e4b3412a199288f
folly/Makefile.am
folly/portability/Atomic.h [new file with mode: 0755]
folly/test/AtomicHashMapTest.cpp