X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2FMicroLock.cpp;h=e42bd6dd3d3b8d495091152746d7cb8ac3b4a31f;hp=dd649da1b431e9a25c027c98838e78691eb62a55;hb=f2925b23df8d85ebca72d62a69f1282528c086de;hpb=e756d07cd35714d7528444321ea5145b41f5ae0f diff --git a/folly/MicroLock.cpp b/folly/MicroLock.cpp index dd649da1..e42bd6dd 100644 --- a/folly/MicroLock.cpp +++ b/folly/MicroLock.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ #include #include +#include + namespace folly { void MicroLockCore::lockSlowPath(uint32_t oldWord, @@ -24,7 +26,7 @@ void MicroLockCore::lockSlowPath(uint32_t oldWord, uint32_t slotHeldBit, unsigned maxSpins, unsigned maxYields) { - unsigned newWord; + uint32_t newWord; unsigned spins = 0; uint32_t slotWaitBit = slotHeldBit << 1; @@ -49,7 +51,7 @@ retry: // sched_yield(), but more portable std::this_thread::yield(); } else { - folly::asm_pause(); + folly::asm_volatile_pause(); } oldWord = wordPtr->load(std::memory_order_relaxed); goto retry; @@ -63,4 +65,4 @@ retry: goto retry; } } -} +} // namespace folly