Fix data race in IndexedMemPool
authorMaged Michael <magedmichael@fb.com>
Fri, 10 Mar 2017 23:34:07 +0000 (15:34 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 10 Mar 2017 23:35:38 +0000 (15:35 -0800)
commit95310177db919718d72f966da6f2a746f09e63dc
treedfdf24ff7b62edaee1fd98225ef882cfccea26cf
parent01919b98fd78769d8e73dc2c0f959743393e886e
Fix data race in IndexedMemPool

Summary:
IndexedMemPool uses regular memory for the global and local next links. There can be concurrent reads and writes of such links. In order to avoid C++ undefined behavior due to the data races, these links should be atomic. Relaxed loads and stores are sufficient for correctness.

Depends on D4680286

Reviewed By: nbronson

Differential Revision: D4680317

fbshipit-source-id: 27c0d888e08bd5d862aee4c6dc6ee393033b32e3
folly/IndexedMemPool.h