Commit 70137200 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: meyering

Differential Revision: D5732693

fbshipit-source-id: 386816f0d97c145ff8a4180d41c8a682694aa6cb
parent 985a7f47
...@@ -39,14 +39,11 @@ ...@@ -39,14 +39,11 @@
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <cinttypes> #include <cassert>
#include <cstdlib> #include <cstdint>
#include <mutex> #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>
...@@ -86,11 +83,11 @@ struct MicroSpinLock { ...@@ -86,11 +83,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