Fix invalid DCHECK
authorAnton Likhtarov <alikhtarov@fb.com>
Thu, 19 Nov 2015 19:32:26 +0000 (11:32 -0800)
committerfacebook-github-bot-9 <folly-bot@fb.com>
Thu, 19 Nov 2015 20:20:25 +0000 (12:20 -0800)
commit2fa98577f4b73f8a2180fb88b5f075cce6d650e6
treed3766dc1de2e5f63c792d28ccb5ce5b57faa94ab
parentf2daf056924961a0f6739bfe5b5ae7b22955dbfd
Fix invalid DCHECK

Summary: There's a race between insert() and erase(): as soon as insert()
releases the lock (swaps kLockedKey_ with the actual key), an erase() might
jump in and invalidate the key.

As far as I can tell, this bug existed since the beginning.

Reviewed By: nbronson

Differential Revision: D2673099

fb-gh-sync-id: 4721893d2ad4836e11acc0fb4ecb0dd7b2b69be1
folly/AtomicHashArray-inl.h
folly/test/AtomicHashMapTest.cpp