Support PicoSpinLock on MSVC
authorChristopher Dykes <cdykes@fb.com>
Tue, 26 Jul 2016 23:17:39 +0000 (16:17 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Tue, 26 Jul 2016 23:23:31 +0000 (16:23 -0700)
commit369761f0999b218383f468bfeebdf6b1a07d79ca
tree49386209825b61d2a450bdebe9a0e26eeade5be3
parentd67d48ea74653c03421b49f3dbae156d66673ab1
Support PicoSpinLock on MSVC

Summary:
It was using inline assembly in order to get atomic single-bit operations, so add a variant for MSVC that uses intrinsics.
MSVC is also weird in-that it doesn't have a 16-bit variant of these, so use an atomic OR and AND to achieve the required effect.

Reviewed By: yfeldblum

Differential Revision: D3623220

fbshipit-source-id: b4ff985ef2ed7787115f4d20de6f244123410dc8
folly/PicoSpinLock.h