Commit 053fb025 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Shrink MicroSpinLock.h transitive includes and inline methods

Summary: [Folly] Shrink `MicroSpinLock.h` transitive includes and inline methods.

Reviewed By: Orvid

Differential Revision: D5714883

fbshipit-source-id: 1744685ff9fa8d3620aef2545c8fe3ebc481df06
parent 951a822c
...@@ -39,17 +39,18 @@ ...@@ -39,17 +39,18 @@
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <cinttypes> #include <cassert>
#include <cstdlib> #include <cstdint>
#include <mutex>
#include <type_traits> #include <type_traits>
#include <boost/noncopyable.hpp>
#include <glog/logging.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/detail/Sleeper.h> #include <folly/detail/Sleeper.h>
FOLLY_NAMESPACE_STD_BEGIN
template <class Mutex>
class lock_guard;
FOLLY_NAMESPACE_STD_END
namespace folly { namespace folly {
/* /*
...@@ -86,11 +87,11 @@ struct MicroSpinLock { ...@@ -86,11 +87,11 @@ struct MicroSpinLock {
sleeper.wait(); sleeper.wait();
} }
} while (!try_lock()); } while (!try_lock());
DCHECK(payload()->load() == LOCKED); assert(payload()->load() == LOCKED);
} }
void unlock() { void unlock() {
CHECK(payload()->load() == LOCKED); assert(payload()->load() == LOCKED);
payload()->store(FREE, std::memory_order_release); payload()->store(FREE, std::memory_order_release);
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* @author Jordan DeLong <delong.j@fb.com> * @author Jordan DeLong <delong.j@fb.com>
*/ */
#include <cinttypes> #include <cstdint>
#include <folly/portability/Asm.h> #include <folly/portability/Asm.h>
#include <folly/portability/Time.h> #include <folly/portability/Time.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment