From: Christopher Dykes Date: Wed, 3 Aug 2016 21:04:35 +0000 (-0700) Subject: Fix a typo in PicoSpinLock X-Git-Tag: v2016.08.08.00~30 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0ce4e4c6ddc84041b322b9268f8273a9e5d7e215;p=folly.git Fix a typo in PicoSpinLock Summary: Because I fail at typing underscores apparently. This also switches the shifts over to using `kLockBitMask_` instead, which was already defined for us. Reviewed By: yfeldblum Differential Revision: D3652483 fbshipit-source-id: 6bd527beeb90bea8ee7632c0a3bfbbb9e0a7e2e7 --- diff --git a/folly/PicoSpinLock.h b/folly/PicoSpinLock.h index 9f52a7a9..218b3062 100644 --- a/folly/PicoSpinLock.h +++ b/folly/PicoSpinLock.h @@ -132,7 +132,8 @@ struct PicoSpinLock { switch (sizeof(IntType)) { case 2: // There is no _interlockedbittestandset16 for some reason :( - ret = _InterlockedOr16((volatile short*)&lock, 1 << Bit) & (1 << Bit); + ret = _InterlockedOr16( + (volatile short*)&lock_, (short)kLockBitMask_) & kLockBitMask_; break; case 4: ret = _interlockedbittestandset((volatile long*)&lock_, Bit); @@ -210,7 +211,7 @@ struct PicoSpinLock { switch (sizeof(IntType)) { case 2: // There is no _interlockedbittestandreset16 for some reason :( - _InterlockedAnd16((volatile short*)&lock, ~(1 << Bit)); + _InterlockedAnd16((volatile short*)&lock_, (short)~kLockBitMask_); break; case 4: _interlockedbittestandreset((volatile long*)&lock_, Bit);